Example 5. (1MO-23-1)
The function $f(n)$ is defined for all positive integers $n$, taking non-negative integer values. For all positive integers $m, n$, $f(m+n)-f(m)-f(n)=0$ or 1;

and $f(2)=0, f(3)>0, f(9999)=3333$. Find $f(1982)$.
Solve $0=f(2) \geqslant 2 f(1)$, we get $f(1)=0$.
From $f(3)-f(2)-f(1)=0$ or 1, we get $0 \leqslant f(3) \leqslant 1$.

Given $f(3)>0$, we get $f(3)=1$.
First, we prove that for $k3333,
\end{aligned}
$$

Contradicting the given condition, so it must be that $f(3k)=k$.
It is clear that $660 \leqslant \hat{j}(1332) \leqslant 861$,

If $f(1982)=661$ then
$$
\begin{array}{c}
f(9 \text { 9.9) }=\hat{j}(5 \times 1982+89) \\
\quad \geqslant 5 f(1982)+f(89) \\
\quad \geqslant 5 \times 661+f(87) \\
\quad \geqslant 3305+29>3333,
\end{array}
$$

Contradicting the given condition. So it must be that
$$
f(1982)=660 \text {. }
$$