3. Find all functions $f: \mathbf{R} \rightarrow \mathbf{R}$ such that for all $x, y \in \mathbf{R}$,
$$
f(y f(x+y)+f(x))=4 x+2 y f(x+y)
$$

holds.
3. Let $y=0$, we get $f(f(x))=4 x$. Then $f$ is injective.
$$
\begin{array}{l}
\text { By } f(0)=f(4 \times 0)=f(f(f(0)))=4 f(0) \\
\Rightarrow f(0)=0 .
\end{array}
$$

Let $x=0, y=1$, we get
$$
\begin{array}{l}
2 f(1)=f(f(1))=4 \Rightarrow f(1)=2 \\
\Rightarrow f(2)=f(f(1))=4 .
\end{array}
$$

Let $y=1-x$, we get
$$
\begin{array}{l}
f((1-x) f(1)+f(x))=4 x+2(1-x) f(1) \\
\Rightarrow f(2(1-x)+f(x))=4=f(2) \\
\Rightarrow 2(1-x)+f(x)=2 \\
\Rightarrow f(x)=2 x .
\end{array}
$$

Upon verification, $f(x)=2 x$ satisfies the requirements.