Solution by Hip1zzzil.
Denote the assertion as P(x,y).
If
f≡0,
it satisfies.
If not, there exists some real a such that
f(a)=0.
From P(a,y),
f(af(a)+f(a)f(y))=af(a)+yf(a),
therefore f is bijective.
From P(0,1),
f(f(0)f(1))=f(0),
so
f(0)f(1)=0.
From P(1,0),
f(f(1)+f(1)f(0))=f(1),
so
f(1)+f(1)f(0)=1.
By combining the above two, we get
f(1)=1,f(0)=0.
Now, from P(−f(y),y),
0=f(0)=−f(y)f(−f(y))+yf(−f(y)),
so
f(y)f(−f(y))=yf(−f(y)).
Therefore,
f(y)=y
or
f(−f(y))=0.
But in the second case,
−f(y)=0
for all y∈R, so contradiction. Therefore
f(x)=x
for all x∈R.