Let f(0)=c. For any t≥0, substituting (x,y)=(0,t) and (x,y)=(t,0) respectively gives
f(tf(t))=f(t),f(tf(t))=t+f(0).
Hence f(t)=t+c for all t≥0. Now setting y=0 and taking t>0 sufficiently large, we get
f(tf(t))=t2+c.
Since f(t)=t+c and t(t+c)≥0 for sufficiently large t, we may use the above formula for nonnegative arguments to obtain t(t+c)+c=t2+c, hence ct=0 and therefore c=0. Thus
f(t)=t(t≥0).
It remains to consider y<0. Fix y<0 and choose x>0 sufficiently large such that x2+yf(y)≥0. Applying the functional equation and using f(x)=x for x≥0, we obtain
f(x2+yf(y))=x2+y2.
The argument on the left is nonnegative, so f(u)=u gives x2+yf(y)=x2+y2, and hence f(y)=y. Therefore f(x)=x for every x∈R.
Finally, f(x)=x indeed satisfies the equation, since