It is easy to see that f(0)=0 and f(x2)=xf(x) for all x∈R. If f(α)=0 for some α, then
f(x2+xf(α))=xf(x+α),
for all x∈R. Therefore
xf(x+α)=f(x2)=xf(x),
for all x∈R. For x=0, we get f(x)=f(x+α). Note that this is also valid for x=0. Suppose f(1)=0. Then
f(1+f(x))=f(x+1),
so that f(f(x))=f(x) for all x. If there exists a λ∈R such that f(λ)=0, then for any t∈R, taking s=t/f(λ), we have
f(s2+sf(λ−s))=sf(s+λ−s)=sf(λ)=t
which shows that f is onto. Hence there exists x0 such that f(x0)=1. This gives
1=f(x0)=f(f(x0))=f(1)=0,
which is absurd. Thus f(1)=0 forces f(x)=0 for all x∈R.
Suppose f(1)=0. Let α∈R be such that f(α)=0. As we have seen earlier, f(x+α)=f(x)=0 for all x. Therefore
f(α2+1)f(α2+1)=f((1+α)2+(1+α)f(α))=(α+1)f(1+2α)=(α+1)f(1),=f((1−α)2+(1−α)f(α))=(1−α)f(1).
These show that 1+α=1−α. Therefore α=0. Thus f(α)=0 implies that α=0.
Taking x=−y in the equation, we get f(y2−yf(y))=yf(y−y)=0. Hence y2−yf(y)=0 for all y∈R. This gives f(y)=y for all y=0. Since f(0)=0, we conclude that f(y)=y for all y∈R.