Solution by jasperE3.
Let P(x,y) be the assertion f(xf(y)+yf(x))=2xy.
Claim: f is injective.
Let f(a)=f(b).
P(a,a)⇒f(2af(a))=2a2.
P(b,b)⇒f(2bf(b))=2b2.
P(a,b)⇒f(af(b)+bf(a))=2ab.
P(2af(a),2bf(b))⇒f(4a2bf(b)+4ab2f(a))=8abf(a)2.
P(af(b)+bf(a),af(b)+bf(a))⇒f(4a2bf(b)+4ab2f(a))=2(a+b)2f(a)2.
Comparing, we obtain (a+b)2f(a)2=4abf(a)2. Now if f(a)=f(b)=0 then P(0,0)⇒f(0)=0, and our expressions for P(a,a) and P(b,b) give a=b=0. On the other hand, if f(a)=0 then (a+b)2=4ab and we again have a=b. So in either case f(a)=f(b) implies a=b.
The rest is easier.
P(21,21)⇒f(f(21))=21.
P(f(21),f(21))⇒21=2f(21)2, so f(21)=±21. Likewise:
P(−21,−21)⇒f(−f(−21))=21, by injectivity f(−21)=−f(21) and so either f(21)=21, f(−21)=−21 or f(21)=−21, f(−21)=21. Notice that f(x) is a solution iff f(−x) is, so WLOG we can have the first option f(21)=21 and f(−21)=−21.
P(x,21)⇒f(2x+f(x))=x, taking x↦f(x) here we have:
f(2f(x)+f(f(x)))=f(x)⇒2f(x)+f(f(x))=x⇒f(f(x))=2x−f(x).
Finally:
4x2−4xf(x)+2f(x)2=2xf(f(x))+2f(x)2−2xf(x)=P(x,f(x))2xf(f(x))+2f(x)2−f(xf(f(x))+f(x)2)=f(f(xf(f(x))+f(x)2))=P(x,f(x))f(2xf(x))=P(x,x)2x2
which simplifies to 2(x−f(x))2=0, i.e. f(x)=x. The solution f(−x) is f(x)=−x.