2. Find all functions $f: \mathbf{Z} \rightarrow \mathbf{Z}$, such that
$$
f(-f(x)-f(y))=1-x-y \quad (x, y \in \mathbf{Z}) .
$$
2. $f(x)=x-1$.

It is easy to verify that $f(x)=x-1$ satisfies the functional equation.
Assume the function $f: \mathbf{Z} \rightarrow \mathbf{Z}$ satisfies
$$
f(-f(x)-f(y))=1-x-y \text {. }
$$

Let $y=1$. Then $f(-f(x)-f(1))=-x$.
Let $x=1$. Then $f(-2 f(1))=-1$.
Let $n \in \mathbf{Z}$.
Let $x=n$. Then $f(-f(n)-f(1))=-n$.
Take $x=-f(n)-f(1), y=-2 f(1)$. We get
$$
\begin{array}{l}
f(n+1)=1+(f(n)+f(1))+2 f(1) \\
\Rightarrow f(n+1)=f(n)+3 f(1)+1 .
\end{array}
$$

Starting from $n=1$, whether using forward induction or backward induction, we can prove
$$
f(n)=(3 n-2) f(1)+n-1 \text {. }
$$

Let $n=0$, then $f(0)=-2 f(1)-1$.
Take $x=0, y=1$. We get
$$
\begin{array}{l}
f(-f(0)-f(1))=0 \\
\Rightarrow f(f(1)+1)=0 .
\end{array}
$$

If $n=f(1)+1$, then
$$
\begin{array}{l}
(3(f(1)+1)-2) f(1)+(f(1)+1)-1=0 \\
\Rightarrow f(1)(3 f(1)+2)=0 .
\end{array}
$$

Since $f(1)$ is an integer, therefore, $f(1)=0$.
Thus, $f(n)=n-1$.