Solution by benjaminchew13.
Let P(x,y) denote f(f(x)2+f(xy))=f(x2)+xy.
P(1,y):f(f(y)+f(1)2)=y+f(1), so we have that f is bijective.
P(0,0):f(0)2+f(0)=0, so f(0)∈{0,−1}.
P(x,0):f(x)2=x2−f(0).
f(f(x)2+f(xy))=f(x2)+xy.
f(x2−f(0)+f(xy))=f(x2)+xy.
f(x2−f(0)+f(xy))2=f(x2)2+2xyf(x2)+x2y2.
−x2f(0)−f(0)+(x2−f(0))f(xy)=xyf(x2).
Case 1 : f(0)=−1
Note that we have f(x)2=x2+1 for all x.
(x2+1)(f(xy)+1)=xyf(x2).
(x2+1)2(f(xy)2+2f(xy)+1)=x2y2f(x2)2.
f(xy)=−(x2+1)2x4y2+x4+2x2+1.
If we take y→xy and x=0, we have f(y)+1=−(x2+1)2x2y2 for all x=0.
Then if we take x=1 we have f(y)+1=−4y2, so (x2−1)2y2=0 for all x=0 and y, which is obviously false.
So there are no solutions for this case.
Case 2 : f(0)=0.
We have f(x)2=x2 for all x.
Then we have x2f(xy)=xyf(x2) for all x and y.
x=1 gives f(y)=yf(1) for all y, and since f(1)2=1, we have f(1)=1 or f(1)=−1.
So f(x)≡x and f(x)≡−x, and checking gives that both of them are solutions.
So the only solutions are f(x)≡x and f(x)≡−x.