Example 10 ([37.3]) Let $S$ be the set of all non-negative integers. Find all functions $f(m)$ defined on $S$ that take values in $S$ and satisfy the condition $f(m+f(n))=f(f(m))+f(n)$ for all $m, n \in S$.
(i)
$$\begin{array}{l} 
f(f(0))=f(0+f(0))=f(f(0))+f(0) \Rightarrow f(0)=0 \\
\Rightarrow f(f(m))=f(m) \Rightarrow f(m+f(n))=f(m)+f(n), \\
f(m+f(n))=f(f(m))+f(n) \\
\Leftrightarrow f(m+f(n))=f(m)+f(n), f(0)=0 .
\end{array}$$
(ii) $f(2 f(n))=2 f(n)$. By induction, we get $f(k f(n))=k f(n)$.
(iii) From $f(f(m))=f(m)$, we know that the function $f$ has fixed points, and all the fixed points are the values that $f(m)$ can take.
(iv) If $f(n) \equiv 0$, it clearly satisfies the requirement. Otherwise, let $a \geqslant 1$ be the smallest fixed point of $f(m)$ (i.e., the smallest positive integer value that $f(m)$ can take), i.e., $f(a)=a, f(r) \neq r, 1 \leqslant r1$, let $n=k a+r, 0 \leqslant r<a$, then (here we use the division with remainder from Chapter 1, §3)
$$\begin{aligned}
f(n) & =f(r+k a)=f(r+k f(a))=f(r+f(k f(a))) \\
& =f(r)+f(k f(a))=f(r)+k a
\end{aligned}$$
$n$ is a fixed point of $f$ $\Longleftrightarrow r=f(r), 0 \leqslant r<a \Longleftrightarrow r=0$, i.e., $n=k a$. Since $f(n)$ is a fixed point of $f$, we have $f(n)=g(n) a$, where $g(k a)=k$. Therefore,
$$f(n)=k a+f(r)=k a+g(r) a=([n / a]+g(r)) a,$$

where $g(0)=0, g(r)(1 \leqslant r<a)$ can be chosen arbitrarily.