Solution by benjaminchew13.
The solutions are precisely the additive involutions:
f(x+y)=f(x)+f(y)andf(f(x))=x
for all real x,y.
For x=0, the value xy can be any real number. Hence the equation is equivalent to
f(u+f(t))=f(u)+t(1)
for every u∈R and every t>0.
Let G be the additive subgroup generated by the numbers f(t) with t>0. Relation (1) lets us define a homomorphism φ:G→R by
φ(f(t))=t(t>0);
it is well-defined because if a sum of generators is 0, applying the corresponding translations in (1) to any input forces the same sum of the corresponding positive numbers to be 0. Thus
f(u+h)=f(u)+φ(h)(2)
for all u∈R and h∈G. In particular, φ is surjective, since all positive real numbers lie in its image.
Now take any h∈G and choose t>0 so large that t+h>0. Since both t and t+h are positive, f(t) and f(t+h) lie in G. From (2),
f(t+h)−f(t)=φ(h),
so φ(h)∈G. Applying φ gives
φ2(h)=φ(f(t+h))−φ(f(t))=(t+h)−t=h.
Since φ is onto and φ(G)⊆G, we get G=R. Therefore (2), with u=0, gives
f(x)=f(0)+φ(x)(3)
for every real x, where φ is an additive involution.
For t>0, we also have φ(f(t))=t. Using (3),
t=φ(f(t))=φ(f(0))+φ2(t)=φ(f(0))+t,
so φ(f(0))=0. Since φ2=id, this gives f(0)=0. Hence f=φ, so f is additive and f(f(x))=x for all x.
Conversely, any additive involution satisfies
f(f(x2)+xy)=x2+f(xy),
so the characterization is complete. Equivalently, as in FE-0006, these functions are obtained from a decomposition R=A⊕B into Q-vector spaces by f(a+b)=a−b.