Solution by maromex.
Let P(x,y) denote the given assertion f(f(x)+f(xy))=f(x)+xf(y).
Claim: For any real numbers a and b with f(a)=f(b), either a=b or f(a)=f(b)=0 (or both).
Proof: Use P(a,b) and P(b,a) to get
(1+a)f(a)=f(a)+af(b)=f(f(a)+f(ab))=f(f(b)+f(ab))=f(b)+bf(a)=(1+b)f(a)..
This means f(a)=0 or 1+a=1+b. □
P(0,0):f(2f(0))=f(0). By the Claim, we have 2f(0)=0 or f(2f(0))=f(0)=0; in both cases, f(0)=0.
P(x,0):f(f(x))=f(x). By the Claim, we have f(x)=x or f(f(x))=f(x)=0. This means
f(x)∈{0,x}
for all real x.
Case 1: f(x)=0 for all real x
This function works.
Case 2: f(x)=0 for all real x=−1, and f(−1)=0
We have f(−1)=−1.
P(−1,1):f(−2)=f(−1), a contradiction.
Case 3: f(y0)=0 for some real y0=−1
We have f(y0)=y0∈{−1,0}.
P(x,y0):f(f(x)+f(xy0))=f(x)+xy0.
We have xy0∈{−x,0} and f(x)∈{0,x}, so f(x)+xy0=0. This means f(f(x)+f(xy0))=0 and therefore f(f(x)+f(xy0))=f(x)+f(xy0).
So f(x)+f(xy0)=f(x)+xy0, which means f(xy0)=xy0 for all real x. As y0=0 this means f(x)=x for all real x. This function works.
Combining cases, the two functions that work are f(x)=0 for all real x and f(x)=x for all real x.