Solution by YuvanRaja.
This problem is similar to #7 (2022 A6).
Denote the assertion by P(x,y).
Let V = Im(f).
P(−f(0),0) gives
f(−f(0)+f(0))=f(−f(0))+f(0)⟹f(−f(0))=0.
So, 0∈V.
Claim 1: a∈V⟹−a∈V.
Proof: If a=−f(0), the result is trivial. So we assume a=−f(0), and a=f(t).
Then P(−a−f(0),−a−f(0)t) gives f(−a−f(0)+f(t))=f(−a−f(0))+f(t)⟹f(−f(0))=a+f(−a−f(0))⟹−a=f(−a−f(0)).
Claim 2: a,b∈V⟹a+b∈V.
Proof: If a=f(0), and b=f(0), Then P(0,0) gives f(f(0))=2f(0)=a+b.
Otherwise, WLOG, a=f(0). So, we have a=f(z), b=f(w), z=0. Then P(z,zw) gives f(z+f(w))=f(z)+f(w)⟹f(z+f(w))=a+b.
Hence, V is a subgroup of (R,+). Let S be a set of coset representatives for R/V. Hence every real number x has a unique representation s + v, where s∈S and v∈V.
Now suppose a, b are in the same additive coset of R/V, with a=b. Then b−a∈V, so let b−a=f(t). WLOG a=0, as a, b are distinct. Then P(a,t/a) gives f(a+f(t))=f(a)+f(t)⟹f(b)=f(a)+b−a⟹f(a)−a=f(b)−b. So f(a)−a is fixed across all members of each additive coset. In particular, f(a)−a=f(s)−s, where s is such that a=s+v is the unique representation of a into S+V. So f(a)=f(s)−s+a=f(s)+v. So f is defined by its values on S.
In fact, this is a full characterisation of all possible f. In other words, f can be defined as follows. Let V be a subgroup of (R,+). Let S be a set of coset representatives of R/V. Hence, every real number x can be represented uniquely as x=s+v, where s∈S and v∈V. Now choose an arbitrary function g:S→V. Define f(x)=g(s)+v.
It remains to show these functions all work.
Suppose x=s1+v1, xy=s2+v2. f(x+f(xy))=f(x+g(s2)+v2)=f(s1+(v1+v2+g(s2)).
We know v1+v2+g(s2)∈V, as V is closed under addition.
So f(s1+(v1+v2+g(s2))=g(s1)+v1+v2+g(s2)=g(s1)+v1+g(s2)+v2=f(x)+f(xy).