Note: we show the solution for the statement in the AoPS thread, which has x and y swapped.
Solution by TLP.39.
We claim the only solutions are f(x)≡x and f(x)≡−x, which obviously work. We now show they are the only solutions. Let P(x,y) denote the assertion that f(xf(x)+y)=x2+f(y).
Since P(x,0) and P(x,−xf(x)) implies that f(xf(x))=x2+f(0) and f(−xf(x))=f(0)−x2, f is surjective.
Let a be the real number such that f(a)=0. P(a,y) implies that a=0. Hence f(0)=0 and f(r)=0⟹r=0 for all r. In particular, if for some c, we have f(x)=f(x+c) for all real x, then c=0.
Let b be the real number such that f(b)=1. P(b,0) implies that b2=1. Since it’s easy to prove that f(x) is a solution iff g(x)≡f(−x) is a solution, we can assume WLOG that b=1⟹f(1)=1.
P(x,0)⟹f(xf(x))=x2.
P(1,x)⟹f(x+1)=f(x)+1.
P(x+1,y),P(x,f(x)+x+y+1)⟹f(f(x)+x+y+1)−f(y)=2x+1⟹f(f(x)+x+y)−f(y)=2x.
From the above equation, we can see that
f(f(x)+f(y)+x+y+z)⟹f(x)+f(y)=f(f(x)+x+z)+2y=f(z)+2x+2y=f(f(x+y)+(x+y)+z)=f(x+y).
Hence, f is additive.
Thus, P(f(x)+x,0)⟹2f(xf(x))+2f(x2)=(f(x)+x)2⟹2(x2+f(x2))=(f(x)+x)2.
Finally, we have
f(f(2x2)+2x2+y)f(2(f(x2)+x2)+y)f((f(x)+x)2+y)⟹(f(x)+x)2⟹f(x)=x=4x2+f(y)=f(2xf(2x)+y)=f(4xf(x)+y)=4xf(x).
Hence, the only solution (with the assumption that b=1) is the identity function. Generalize back, we get that the solutions are f(x)≡x and f(x)≡−x.