3. Find all functions $f: \mathbf{R} \rightarrow \mathbf{R}$, such that for any real numbers $x, y$, we have
$$
f(f(x y-x))+f(x+y)=y f(x)+f(y) .
$$
3. Let $x=0$, we get $f(f(0))=y f(0)$.

From the arbitrariness of $y$ we have
$$
f(0)=0 \Rightarrow f(f(0))=0 \text {. }
$$

Let $y=1$, we get $f(x+1)=f(x)+f(1)$.
Then replace $y$ with $y+1$ to get
$$
\begin{array}{l}
f(f(x y))+f(x+y) \\
=y f(x)+f(x)+f(y) .
\end{array}
$$

By the symmetry of $x$ and $y$, we have
$$
y f(x)=x f(y) \text {. }
$$

Thus, $f(x)=c x(c=0,1)$.
Upon verification, $f(x)=0, f(x)=x$ are the solutions.