Solution by benjaminchew13.
Let P(x,y) denote f(f(x)+f(xy))=x+yf(x) for all reals x and y.
P(0,0):f(2f(0))=0.
P(0,1):f(0)=0.
P(x,0):f(f(x))=x, therefore f is bijective.
P(1,y):f(f(y)+f(1))=yf(1)+1.
P(1,f(y)):f(y+f(1))=f(y)f(1)+1.
P(−1,−f(y)):f(y+f(−1))=−f(y)f(−1)−1.
f(f(1)+f(−1))=f(f(−1))f(1)+1=1−f(1).
f(f(1)+f(−1))=−f(f(1))f(−1)−1=−f(−1)−1.
So we have f(−1)=f(1)−2.
f(y+f(−1))=f(y+f(1)−2)=−f(y)f(1)+2f(y)−1.
f(y+f(1)−2)=f(y−2)f(1)+1, so we have f(y−2)f(1)+2=f(y)(2−f(1)).
y=1 gives 2f(1)2−4f(1)+2=0, so f(1)=1.
Then P(1,f(y)):f(y+1)=f(y)+1.
P(x,x1):f(x)=x for all x=0.
But since f(0)=0, we have f(x)≡x, which can be easily verified to be a solution.