Solution by ben13jamin.
Let P(x,y) be the assertion
f(xf(x)+f(xy))=x2+yf(x).
Putting x=0 shows that f(0)=0. Then P(−1,1) gives f(−1)=−1, and P(−1,0) gives f(1)=1.
From P(1,y),
f(1+f(y))=1+y,
so f is bijective. Also P(1,1) gives f(2)=2. Using P(2,y/2),
f(4+f(y))=4+y.
Comparing this with P(1,y+3) and using injectivity, we get
f(y+3)=f(y)+3
for every real y.
Now take any x=0 and replace y by y+3/x in P(x,y). Using the shift identity twice,
f(xf(x)+f(xy+3))=f(xf(x)+f(xy)+3)=f(xf(x)+f(xy))+3.
Thus the left side becomes x2+yf(x)+3, while the right side is
x2+(y+x3)f(x).
Hence 3=3f(x)/x, so f(x)=x for every x=0. Since f(0)=0, the unique solution is
f(x)=x for all x.