3. Find all mappings $f: \mathbf{Z} \rightarrow \mathbf{Z}$, such that for any $m, n \in \mathbf{Z}$, we have $f(f(m+n))=f(m)+f(n)$.
3. Let $f(0)=a \in \mathbf{Z}$, and set $n=0$, then
$$
f(f(m))=f(m)+f(0)=f(m)+a \text {. }
$$

In equation (1), let $m=x+y(x, y \in \mathbf{Z})$, then
$$
f(f(x+y))=f(x+y)+a \text {. }
$$

Combining with the original condition, we get
$$
f(x)+f(y)=f(x+y)+a \text {. }
$$

Let $g(x)=f(x)-a$. From equation (2), we have
$$
\begin{array}{l}
g(x+y)=f(x+y)-a \\
=f(x)+f(y)-2 a \\
=g(x)+g(y) .
\end{array}
$$

Let $g(1)=b \in \mathbf{Z}$.
In equation (3), let $x=y=1$, then
$$
g(2)=g(1)+g(1)=2 b \text {; }
$$

In equation (3), let $x=2, y=1$, then
$$
g(3)=g(2)+g(1)=3 b \text {. }
$$

By mathematical induction, it is easy to prove that for any $n \in \mathbf{Z}_{+}$, we have
$$
g(n)=n b .
$$

In equation (3), let $x=y=0$, then
$$
g(0)=2 g(0) \Rightarrow g(0)=0 \text {. }
$$

In equation (3), let $x=n, y=-n$, then
$$
\begin{array}{l}
g(0)=g(n)+g(-n)=0 \\
\Rightarrow g(-n)=-g(n)=-n b .
\end{array}
$$

Combining equations (4), (5), and (6), we know that for any $n \in \mathbf{Z}$, we have $g(n)=n b$.
Thus, $f(n)=g(n)+a=n b+a$.
Substituting equation (7) into equation (1), we get
$$
\begin{array}{l}
b(b m+a)+a=f(b m+a) \\
=f(m)+a=b m+2 a \\
\Rightarrow(b m+a)(b-1)=0 \\
\Rightarrow b=1 \text { or } b m+a=0 .
\end{array}
$$

When $b=1$, $f(n)=n+a$;
and $b m+a=0$ holds for any $m \in \mathbf{Z}$
if and only if $a=b=0$, in which case, $f(n)=0$.
Therefore, $f(n)=n+a$ or $f(n)=0$.
Upon verification, both cases satisfy the problem's conditions.
In conclusion, $f(n)=n+a(a \in \mathbf{Z})$ or $f(n)=0$.