Find all functions \( f: \mathbf{R} \rightarrow \mathbf{R} \) satisfying the equation

\[
| x | f(y) + y f(x) = f(x y) + f\left(x^2\right) + f(f(y))
\]

for all real numbers \( x \) and \( y \).
Answer: all functions $f(x)=c(|x|-x)$, where $c \geq 0$.

Choosing $x=y=0$, we find

$$
f(f(0))=-2 f(0)
$$

Denote $a=f(0)$, so that $f(a)=-2 a$, and choose $y=0$ in the initial equation:

$$
a|x|=a+f\left(x^{2}\right)+f(a)=a+f\left(x^{2}\right)-2 a \quad \Rightarrow \quad f\left(x^{2}\right)=a(|x|+1)
$$

In particular, $f(1)=2 a$. Choose $(x, y)=\left(z^{2}, 1\right)$ in the initial equation:

$$
\begin{aligned}
& z^{2} f(1)+f\left(z^{2}\right)=f\left(z^{2}\right)+f\left(z^{4}\right)+f(f(1)) \\
\Rightarrow & 2 a z^{2}=z^{2} f(1)=f\left(z^{4}\right)+f(f(1))=a\left(z^{2}+1\right)+f(2 a) \\
\Rightarrow & a z^{2}=a+f(2 a)
\end{aligned}
$$

The right-hand side is constant, while the left-hand side is a quadratic function in $z$, which can only happen if $a=0$. (Choose $z=1$ and then $z=0$.)

We now conclude that $f\left(x^{2}\right)=0$, and so $f(x)=0$ for all non-negative $x$. In particular, $f(0)=0$. Choosing $x=0$ in the initial equation, we find $f(f(y))=0$ for all $y$. Simplifying the original equation and swapping $x$ and $y$ leads to

$$
|x| f(y)+y f(x)=f(x y)=|y| f(x)+x f(y) .
$$

Choose $y=-1$ and put $c=\frac{f(-1)}{2}$ :

$$
|x| f(-1)-f(x)=f(x)+x f(-1) \Rightarrow f(x)=\frac{f(-1)}{2}(|x|-x)=c(|x|-x) \text {. }
$$

One easily verifies that these functions satisfy the functional equation for any parameter $c \geq 0$.