Solution by SMOJ.
We claim the only solutions are f(x)≡x and f(x)≡−x, which obviously work. We now show they are the only solutions. Let P(x,y) denote the assertion that f(xf(y)+x)=xy+f(x).
P(1,y) gives f(f(y)+1)=y+f(1).
Now P(f(x)+1,y) gives f((f(y)+1)(f(x)+1))=yf(x)+y+x+f(1).
Swapping x and y, yf(x)=xf(y) for all x,y, hence f(x)=cx for some real constant c. Checking, only c=1 and c=−1 works.