1. Find all functions $f: \mathbf{Z}_{+} \rightarrow \mathbf{Z}_{+}$, such that for all positive integers $m, n$, we have
$$
\left(m^{2}+f(n)\right) \mid(m f(m)+n) .
$$
1. The function $f(n)=n$ satisfies the condition.

Let $m=n=2$. Then
$$
(4+f(2)) \mid(2 f(2)+2) \text {. }
$$

Since $2 f(2)+2<2(4+f(2))$, we have
$$
2 f(2)+2=4+f(2) \text {. }
$$

Thus, $f(2)=2$.
Let $m=2$. Then $(4+f(n)) \mid(4+n)$.
This indicates that for any positive integer $n$, we have $f(n) \leqslant n$.
Let $m=n$. Then
$$
\begin{array}{l}
\left(n^{2}+f(n)\right) \mid(n f(n)+n) \\
\Rightarrow n f(n)+n \geqslant n^{2}+f(n) \\
\Rightarrow(n-1)(f(n)-n) \geqslant 0 .
\end{array}
$$

This indicates that for all positive integers $n \geqslant 2$, we have $f(n) \geqslant n$, and the conclusion also holds when $n=1$.
Therefore, for all positive integers $n$, we have $f(n)=n$.