Solution by tadpoleloop.
Let P(x,y) denote the assertion
f(f(x2)+f(x)f(y))=f(x2)+xf(y).
The zero function is a solution. From now on, assume f is not constant.
First, P(−1,1) shows that 0 lies in the image of f. Let f(z)=0. Then P(z,y) gives
f(f(z2))=f(z2)+zf(y).
The left side and f(z2) are constant as y varies, so zf(y) is constant. Since f is not constant, we must have z=0. Thus
f(x)=0⟺x=0,
and in particular f(0)=0.
Now P(x,0) gives
f(f(x2))=f(x2)
for all x. Also, comparing P(x,−x) and P(−x,x) gives
f(−x)=−f(x),
so f is odd. Hence the previous identity extends to
f(f(t))=f(t)for all t∈R.
Let R=f(R). The last identity says exactly that R is the set of fixed points of f. Since f is odd, R=−R.
From P(1,−1) and oddness,
f(f(1)−f(1)2)=0.
Since 0 is the unique zero and f(1)=0, this gives f(1)=1. Therefore P(1,y) gives
f(1+f(y))=1+f(y),
so R+1⊆R. Since R=−R, this also gives R−1⊆R, and hence R+1=R. In particular, every integer belongs to R.
For x=0, define
Tx:R→R,Tx(r)=f(x2)+xr.
This maps R to R by P(x,y), and it is injective because x=0. Put
g(x)=f(x2)+xf(x21).
Then
Tx(T1/x(r))=r+g(x).
Thus r+g(x)∈R for all r∈R. Since R=−R, also r−g(x)∈R. Consequently every r∈R lies in the image of Tx, so Tx is bijective.
For x=0 and r∈R,
Tx(T−x−1(r))=2f(x2)−r.
Using oddness gives the same conclusion with f(−x2) in place of f(x2). Since every element of R is of the form f(t), we obtain
2s−r∈Rfor all r,s∈R.
Now take any s∈R. Since T2 is bijective, there exists r∈R such that
s=T2(r)=f(4)+2r=4+2r.
Because 4∈R and R+1=R, this gives s/2=2+r∈R. Hence for r,s∈R,
s−r=2(2s)−r∈R.
So R is an additive subgroup of R.
Finally, f(x2)+f(x)∈R. Applying P(x,1) and using f(1)=1, the left side is fixed by f, so
f(x2)+f(x)=f(x2)+x.
Thus f(x)=x for every x. Therefore the complete solution set is
f(x)≡0andf(x)=x for all x.