Define P(a,b) to be the substitution x=a,y=b into the functional equation.
(1) P(0,y): f(0)=f(0)(f(0)+f(y)). When f(0)=0, f must be a constant function, and in this case f(x)=21,∀x∈R is a solution.
(2) If f(a)=0, then P(a,y): f(ay)=0, which gives that a=0 or f is identically 0, and f identically 0 is indeed a solution.
(3) P(x,−f(x)): 0=f(x)(f(x)+f(−f(x))), so regardless of whether x is 0 or not, we have −f(x)=f(−f(x)).
(4) P(x,0): f(xf(x))=f(x)2. When x=−1, combining with (3) gives f(−1)2=f(−f(−1))=−f(−1), so f(−1)=−1.
(5) P(−1,0): f(1)=1.
(6) P(1,y): f(y+1)=f(y)+1.
(7) P(x,y+1)−P(x,y): f(xy+x+xf(x))=f(x)+f(xy+xf(x)), that is, the Cauchy equation
f(x)+f(y)=f(x+y),∀x,y
(8) f(xy+xf(x))=f(xy)+f(xf(x))=f(xy)+f(x)2=f(x)(f(x)+f(y)), hence we obtain f(xy)=f(x)f(y), and combining this with the Cauchy equation gives f(x)=x,∀x∈R.
(9) In summary, the functions f satisfying the condition are exactly three
f(x)=x,∀x∈R
f(x)=0,∀x∈R
f(x)=21,∀x∈R