Solution by anakinwang.
We claim the only solution is f(x)≡x.
Proof. Let P(x,y) denote the problem assertion. It is clear f(x)≡x satisfies P.
To show this is the only solution, observe P(0,y):f(0)=f(0)f(y) for all y∈R, implying either f(0)=0 or f(y)=1 for all y. The latter implies 1=x2+1 for all x∈R, an absurdity.
As such, f(0)=0; we have P(x,0):f(x2)=x2 for all x∈R, i.e., f(x)=x for all x≥0. Now, fix some x<0, and pick some y∈(0,−x). Since x2+xy>0, it follows that x2+xy=f(x2+xy)=x2+f(x)y, so f(x)=x for all x∈R, as desired.