Solution by OronSH.
We claim the only solution is the identity.
Denote the assertion P(x,y). First P(0,y) gives f(f(0))=f(0)f(y), so f(0)=0 or f is constant, impossible.
Next P(x,0) gives f(f(x2))=x2. In particular we get f(f(1))=1.
Set x=f(1). If there is a solution y for f(x2)+xy=y, then the equation cancels to x2=0, hence f(1)=0, but this implies f(f(1))=f(0)=1, contradiction. Hence there is no solution y, so x=f(1)=1.
Now P(1,y) gives f(y+1)=f(y)+1. Taking the difference now of P(x,y) and P(x,y+1) gives f(f(x2)+xy+x)=f(f(x2)+xy)+f(x). When x=0, by varying y we can make f(x2)+xy take any real value, hence we get f(z+x)=f(z)+f(x) when x=0. Since f(0)=0, this gives f is additive.
Hence from the original equation we have f(f(x2))+f(xy)+x2+f(x)f(y), so f is also multiplicative. Hence f(x2)=f(x)2≥0, so f is bounded on a nontrivial interval. Together with additivity, this implies f linear, and from f(1)=1 we get f(x)=x for all x, as desired.