Solution by megarnie.
We claim that the only solutions are
f≡0andf(x)=x.
Both are checked directly. Now suppose f is not identically zero, and let
P(x,y):f(xf(y)+f(xy))=yf(x)+f(x)f(y).
Also write
g(x)=x+f(x).
From P(0,y),
f(f(0))=f(0)f(y).
If f(0)=0, then f is constant, and the equation immediately forces this constant to be 0, contradiction. Hence
f(0)=0.
Next we show that f(1)=0. Suppose instead that f(1)=0. From P(1,y) and P(x,1) we get
f(2f(y))=0,f(f(x))=f(x).(1)
Choose a with f(a)=0, and put z=f(a). Then f(z)=z and z=0, while f(2z)=0. Applying P(x,2z) gives
f(f(2xz))=2zf(x).
Using (1), this becomes
f(2xz)=2zf(x).
Putting x=21 yields f(21)=21. Then P(2,21) gives f(2)=0, while P(21,2) gives 0=1, a contradiction. Thus
f(1)=0.
Now f is injective. Indeed, if f(c)=f(d), then comparing P(1,c) and P(1,d) gives
f(1)(c+f(c))=f(1)(d+f(d)),
so c=d.
The function g is injective as well. If g(c)=g(d), then P(1,c) and P(1,d) give
f(2f(c))=f(2f(d)).
By injectivity of f, we get f(c)=f(d), hence c=d.
Finally, by P(y,x) and P(x,y),
f(yf(x)+f(xy))=f(y)g(x),
and
f(xf(y)+f(xy))=f(x)g(y).
Therefore
g(yf(x)+f(xy))=yf(x)+f(xy)+f(y)g(x),
and
g(xf(y)+f(xy))=xf(y)+f(xy)+f(x)g(y).
The two right-hand sides are equal, so injectivity of g gives
yf(x)+f(xy)=xf(y)+f(xy).
Thus
yf(x)=xf(y)
for all real x,y. For nonzero x,y, this means f(x)/x=f(y)/y, so f(x)=cx for all x, with f(0)=0 already known.
Substituting f(x)=cx into the original equation gives
2c2xy=cxy+c2xy,
so c2=c. Hence c=0 or c=1, giving exactly the two listed solutions.