TITLE: How find the function $f(f(x)+xy)=f(x)+xf(y),\forall x,y\in R$
QUESTION [8 upvotes]: Find all function $f:R\to R$ and such
$$f(f(x)+xy)=f(x)+xf(y),\forall x,y\in R$$
Let $x=y=0$,then $$f(f(0))=f(0)$$

REPLY [2 votes]: Replace $x=0$ in the given identity, we get
$ f(f(0)) = f(0).$
If we let $f(0) = a$, then 
$$f(a) = a\tag{1}.$$
Replace $y=0$ in the given identity, we get
$$f(f(x)) = f(x) + xf(0) = f(x) + ax.\tag{2}$$
Let $x=a$ in (2), we get
$$f(f(a)) = f(a) + a^2.\tag{3}$$
But from (2), $f(f(a)) = f(a) = a$. So (3) becomes
$$a = a + a^2,\text{or } f(0) = 0.$$
Therefore, (2) becomes
$$ f(f(x)) = f(x), \forall x\in \mathbb R.\tag{4}$$
Replace $x$ by $f(x)$ in the given identity, we have
$$f(f(f(x)) + f(x)y) = f(f(x)) + f(x)f(y).$$
Since $f(f(x)) = f(x)$, we have
$$f(f(x) (y+1)) = f(x)(1+f(y)), \forall x,y.\tag{5}$$
Let $y=-1$ in (5), we see that 
$$ 0 = f(0) = f(x)(1+f(-1)), \forall x.$$
Since $f(x)\not\equiv 0$, $f(-1) = -1$. Now replace $x=-1, y=1$ in (5), we get
$$f(-2) = - 1 - f(1), \forall y.\tag{6}$$
We will now show that $f(1)\ne 0$. Indeed, assume that $f(1)=0$, then $f(-2)=-1$. Replace $x=-1, y=-2$ in (5), we get
$$f(f(-1)(1-2)) = f(-1)(1-2).$$
Since $f(-1)=-1$, the above becomes a contradiction $f(1) = 1$.
Thus we showed that $f(1) = b\ne 0$. Replace $1=1$ in the given identity, we have
$$f(b + y) = b + f(y).$$ 
This and (4) implies that
$$f(b+f(y)) = f(f(b+y)) = f(b+y) = b + f(y), \forall y.\tag{7}$$
Moreover, replace $y=b/x$ in the given identity we get
$$f(f(x) + b) = f(x) + xf(\frac{b}{x}),\forall x\ne 0.$$
The above and (7) gives
$$ b + f(x) = f(x) + xf(\frac{b}{x}), \forall x\ne 0,$$
or 
$$ \frac{b}{x} = f(\frac{b}{x}), \forall x\ne 0.$$
Since $b\ne 0$, it follows that $f(x)=x$ for all $x\ne 0.$ Thus $f(x) = x$ for all $x\in \mathbb R$.