Solution by tadpoleloop.
Let P(x,y) denote the assertion
f(f(x)+xf(y))=x+yf(x).
There are no constant solutions, so choose u with f(u)=0. Then P(u,y) shows that f is surjective. Also, if f(a)=f(b), comparing P(u,a) and P(u,b) gives a=b, so f is injective. Hence f is bijective.
From P(0,y), the left side is constant while the right side is yf(0), so f(0)=0. Therefore P(x,0) gives
f(f(x))=x.
Let a=f(1). Then f(a)=1. From P(1,a),
f(1+a)=1+a2,
while P(a,a) gives
f(1+a)=2a.
Thus 1+a2=2a, so a=1. Hence f(1)=1.
Now P(1,f(y)) gives
f(y+1)=f(y)+1.
We prove additivity. Fix x=0 and s∈R, and set
v=xs−f(x).
Using P(x,f(v)),
f(s)=x+f(x)f(v).
Next apply P(x,f(v)+1). Since f(t+1)=f(t)+1 and f(f(v))=v,
f(f(v)+1)=v+1.
Therefore
f(s+x)=x+f(x)(f(v)+1)=f(s)+f(x).
The case x=0 is immediate from f(0)=0, so f is additive.
Finally, P(x,f(y)) gives
f(f(x)+xy)=x+f(x)f(y).
By additivity and f(f(x))=x, the left side is x+f(xy). Hence
f(xy)=f(x)f(y).
Thus f is additive and multiplicative, with f(1)=1. For t≥0, write t=r2 to get f(t)=f(r)2≥0, so f is order-preserving. Since f fixes every rational number, the order-preserving property forces f(x)=x for every real x. Therefore the unique solution is
f(x)=x for all x.
Direct substitution verifies that it works.