234 Let $R$ be the set of all real numbers.
(1) Find all functions $f: \mathbf{R} \rightarrow \mathbf{R}$ such that for any $x, y \in \mathbf{R}$, we have
$$
\begin{array}{l}
f(x+y) \\
=-2006 x+2007 f(x)-2008 f(y)+2009 y ;
\end{array}
$$
(2) Find all functions $f: \mathbf{R} \rightarrow \mathbf{R}$ such that for any $x, y \in \mathbf{R}$, we have
$$
\begin{array}{l}
x f(x+y) \\
=-2006 x^{2}+2007 f\left(x^{2}\right)-2008 f(x y)+ \\
2009 y f(x) .
\end{array}
$$
Solution: (1) From $f(x+y)=f(y+x)$ and the given conditions, we have
$$
\begin{array}{l}
-2006 x+2007 f(x)-2008 f(y)+2009 y \\
=-2006 y+2007 f(y)-2008 f(x)+2009 x,
\end{array}
$$

which simplifies to $f(x)-x=f(y)-y$.
Thus, we can write $f(x)-x=c$ (where $c$ is a constant to be determined).
Therefore, $f(x)=x+c$.
Substituting this into the given equation, we get
$$
\begin{array}{l}
x+y+c \\
=-2006 x+2007(x+c)- \\
2008(y+c)+2009 y,
\end{array}
$$

which simplifies to $2 c=0, c=0$.
Hence, $f(x)=x (x \in \mathbf{R})$.
(2) From the given conditions, we have
$$
\begin{array}{l}
x f(x+y) \\
=-2006 x^{2}+2007 f\left(x^{2}\right)- \\
2008 f(x y)+2009 y f(x) .
\end{array}
$$

Setting $x=0$ in equation (1), we get
$$
2009 y f(0)=f(0) (\forall y \in \mathbf{R}) \text {. }
$$

Thus, $f(0)=0$.
Setting $y=0$ and $y=-x$ in equation (1), we get
$$
\begin{array}{c}
x f(x)=2007 f\left(x^{2}\right)-2006 x^{2}, \\
0=-2006 x^{2}+2007 f\left(x^{2}\right)- \\
2008 f\left(-x^{2}\right)-2009 x f(x) .
\end{array}
$$

Substituting equation (3) into equation (4), we get
$$
f\left(-x^{2}\right)=-x f(x) \text {. }
$$

From equation (5), we have
$$
-x f(x)=f\left(-x^{2}\right)=f\left(-(-x)^{2}\right)=x f(-x) \text {, }
$$

which implies
$$
f(-x)=-f(x) (\forall x \neq 0) \text {. }
$$

Combining equation (6) with equation (1), we get
$$
f(-x)=-f(x) (\forall x \in \mathbf{R}) \text {. }
$$

From equations (5) and (7), we have
$$
-f\left(x^{2}\right)=-x f(x) (\forall x \in \mathbf{R}),
$$

which simplifies to
$$
f\left(x^{2}\right)=x f(x) (\forall x \in \mathbf{R}) \text {. }
$$

From equations (3) and (8), we get
$$
x f(x)=2007 x f(x)-2006 x^{2},
$$

which simplifies to $x f(x)=x^{2} (\forall x \in \mathbf{R})$.
Thus, $f(x)=x (\forall x \neq 0)$.
Combining equation (9) with equation (2), we get $f(x)=x (\forall x \in \mathbf{R})$.
Clearly, this satisfies the given conditions.