Solution by jasperE3.
Let P(x,y) denote
f(f(x)+f(xy))=x+f(x)f(y).
There are no constant solutions. From P(0,y),
f(2f(0))=f(0)f(y).
Thus, if f(0)=0, then f would be constant, impossible. Hence f(0)=0.
Now P(x,0) gives
f(f(x))=x,
so f is bijective. Let a=f(1). In P(1,y),
f(a+f(y))=1+af(y).
Since f is bijective, we may put y=f(x−a), giving f(y)=x−a. Therefore
f(x)=1+a(x−a)=ax+1−a2.
Using f(0)=0, we get a2=1. Hence the only possible functions are f(x)=x and f(x)=−x, and both satisfy the original equation. Thus
f(x)=x for all xorf(x)=−x for all x.