Solution by jasperE3.
Let P(x,y) denote
f(f(x2)+yf(x))=x2+f(xy).
If f(k)=0 for some k=0, then P(k,y) makes f(ky) constant as y varies, so f would be constant on R. No constant function satisfies the equation. Hence f(k)=0 implies k=0.
Let a=f(0). From P(x,0),
f(f(x2))=x2+a,
so [a,∞)⊆f(R). For x=0, we also have f(x)=0, and substituting
y=−f(x)f(x2)
gives
f(−f(x)xf(x2))=a−x2.
Thus (−∞,a)⊆f(R), so f is surjective. Since 0 is in the image and only 0 can map to 0, we get f(0)=0.
Suppose now that f(k)=k for some k. Then k=0. Set h=f(k2) and
y=k−f(k)h.
The argument on the left of P(k,y) is
h+k−f(k)hf(k)=k−f(k)kh=ky.
Therefore P(k,y) gives f(ky)=k2+f(ky), impossible. Hence f(k)=k for every k, and
f(x)=x for all x.
Direct substitution verifies the solution.