Example: Let $f(x)$ be a function defined on $\mathbf{R}$, for any $x, y \in \mathbf{R}$, we have
$$
f(x+3) \leqslant f(x)+3, f(x+2) \geqslant f(x)+2 .
$$

Let $g(x)=f(x)-x$.
(1) Prove: $g(x)$ is a periodic function;
(2) If $f(998)=1002$, find the value of $f(2000)$.
(1) Proof: From $g(x)=f(x)-x$, we get
$$
\begin{array}{l}
g(x+2)=f(x+2)-x-2, \\
g(x+3)=f(x+3)-x-3 .
\end{array}
$$

Substituting into the inequality in the problem, we get
$$
\begin{array}{l}
g(x+2) \geqslant f(x)+2-x-2=f(x)-x, \\
g(x+3) \leqslant f(x)+3-x-3=f(x)-x .
\end{array}
$$

From equation (1), we get
$$
\begin{array}{l}
g(x+4) \geqslant f(x+2)-x-2 \\
\geqslant f(x)+2-x-2=f(x)-x, \\
g(x+6) \geqslant f(x+2)-x-2 \geqslant f(x)-x .
\end{array}
$$

From equation (2), we get
$$
g(x+6) \leqslant f(x+3)-x-3 \leqslant f(x)-x \text {. }
$$

From equations (3) and (4), we know
$$
g(x+6)=f(x)-x=g(x) \text {. }
$$

Therefore, $g(x)$ is a periodic function (6 is one of its periods).
(2) Solution: Note that, $2000-998=1002$ is a multiple of 6, thus,
$$
\begin{array}{l} 
g(2000)=g(998) \\
\Rightarrow f(2000)-2000=f(998)-998 \\
\Rightarrow f(2000)=f(998)+1002 \\
=1002+1002=2004 .
\end{array}
$$