Find all functions $f: \mathbf{R} \rightarrow \mathbf{R}$ such that for all $x, y \in \mathbf{R}$, we have
$$
f(x f(y))=(1-y) f(x y)+x^{2} y^{2} f(y) .
$$
Solution: Clearly, $f(x) \equiv 0$ satisfies equation (1). Now assume $f(x) \neq 0$.
Substitute $y=1$ into (1), we get
$$
f(x f(1))=x^{2} f(1).
$$

Thus, $f(0)=0$.
Assume $f(1) \neq 0$, take $x=\frac{1}{f(1)}$, then $f(1)=\frac{1}{f(1)}$.
Solving this, we get $f(1)=1$ or $f(1)=-1$.
Therefore, $f(x)=x^{2}$ or $f(x)=-x^{2}$.
However, neither of these functions satisfies equation (1), so $f(1)=0$.
Let $y \neq 0$, substitute $x=\frac{1}{y}$ into (1), we get
$$
f\left(\frac{f(y)}{y}\right)=f(y).
$$

Substitute $x=1$ into (1), we get
$$
f(f(y))=\left(y^{2}-y+1\right) f(y).
$$

Substitute $\frac{f(y)}{y} (y \neq 0)$ for $y$ in (4), and use (3), we get
$$
\begin{array}{l}
f\left(f\left(\frac{f(y)}{y}\right)\right)=\left(\left(\frac{f(y)}{y}\right)^{2}-\frac{f(y)}{y}+1\right) f\left(\frac{f(y)}{y}\right) \\
\Rightarrow f(f(y))=\frac{(f(y))^{3}}{y^{2}}-\frac{(f(y))^{2}}{y}+f(y) \\
\Rightarrow\left(y^{2}-y+1\right) f(y)=\frac{1}{y^{2}}(f(y))^{3}-\frac{1}{y}(f(y))^{2}+f(y) \\
\Rightarrow f(y)\left(f(y)-y^{2}\right)\left(f(y)-y+y^{2}\right)=0(y \neq 0).
\end{array}
$$

Assume there exists some $y_{1} \neq 0,1$, such that
$$
f\left(y_{1}\right)=y_{1}^{2}.
$$

By (4), $f\left(y_{1}^{2}\right)=\left(1-y_{1}+y_{1}^{2}\right) y_{1}^{2}$.
By (5), $f\left(y_{1}^{2}\right)$ must be one of $0, \left(y_{1}^{2}\right)^{2}, y_{1}^{2}-\left(y_{1}^{2}\right)^{2}$, thus, $y_{1}=\frac{1}{2}$, at this time, $f\left(y_{1}\right)=y_{1}-y_{1}^{2}$.
Assume there exists some $y_{2} \neq 0,1$, such that $f\left(y_{2}\right)=0$.
Substitute $y=y_{2}$ into (1), we get
$0=f(0)=\left(1-y_{2}\right) f\left(x y_{2}\right)$.
Thus, $f\left(x y_{2}\right)=0$.
Therefore, $f(x) \equiv 0 (x \in \mathbf{R})$. This contradicts the assumption $f(x) \neq 0$.
From the above discussion and equation (5), we get
$f(y)=y-y^{2} \quad(y \neq 0)$.
Upon verification, $f(x)=x-x^{2}$ satisfies equation (1).
In conclusion, the solutions are $f(x) \equiv 0$ or $f(x)=x-x^{2}$.
Note: This problem was used as a training exam question for the Chinese IMO team before their departure in 2002.
(Wu Weizhao, School of Mathematics and Information Science, Guangzhou University, 510405)