9. (2003 Taiwan Training Problem) Find all functions $f: \mathbf{N} \rightarrow \mathbf{N}$, for all $m, n \in \mathbf{N}$ satisfying $f\left(m^{2}+n^{2}\right)=$ $f^{2}(m)+f^{2}(n)$ and $f(1)>0$.
In
number
theory,
the
following
is
obviously
true: $f(n)=n$ satisfies the condition.

Let $m=n=0$, we have $f(0)=2[f(0)]^{2}$, then
$f(0)=0$ or $\frac{1}{2}$, but $\frac{1}{2}$ is not an integer, so,
$f(0)=0$.
Let $m=0, n=1$, we have
$f(1)=[f(0)]^{2}+[f(1)]^{2}$, i.e., $f(1)=[f(1)]^{2}$.
Then $f(1)=0$ or 1, but $f(1)>0$, so, $f(1)=1$.
Let $S=\{n \mid n \in \mathbf{N}$, and $f(n)=n\}$, then $1,0 \in S$.
First, prove two properties of $S$.
(i) If $a, b \in S$, then $a^{2}+b^{2} \in S$.

Proof: Since $a, b \in S$, then $f(a)=a, f(b)=b$, hence $f\left(a^{2}+b^{2}\right)=[f(a)]^{2}+[f(b)]^{2}=a^{2}+b^{2}$.
Therefore, $a^{2}+b^{2} \in S$.
(ii) If $a \in S, a^{2}+b^{2} \in S$, then $b \in S$.

Proof: Since $a \in S, a^{2}+b^{2} \in S$, then
$f(a)=a$,
$f\left(a^{2}+b^{2}\right)=a^{2}+b^{2}$.
And $f\left(a^{2}+b^{2}\right)=[f(a)]^{2}+[f(b)]^{2}$, so,
$a^{2}+b^{2}=a^{2}+[f(b)]^{2}$.
Thus, $[f(b)]^{2}=b^{2}$, i.e., $f(b)=b$.
Hence, $b \in S$.
(iii) If $a^{2}+b^{2}=c^{2}+d^{2}$, and $b, c, d \in S$, then $a \in S$.

Proof: Since $c, d \in S$, by (i), $c^{2}+d^{2} \in S$.
Therefore, $a^{2}+b^{2} \in S$.
Then, by $b \in S$ and (ii), $a \in S$.
Next, deduce that $0,1,2, \cdots, 15 \in S$ from $0,1 \in S$.
$2=1^{2}+1^{2}$, by (i), $2 \in S$.
$5=1^{2}+2^{2}$, by (i), $5 \in S$.
$4=0^{2}+2^{2}$, by (i), $4 \in S$.
$3^{2}+4^{2}=5^{2}+0^{2}$, by (iii), $3 \in S$.
$7^{2}+1^{2}=5^{2}+5^{2}$, by (iii), $7 \in S$.
$8=2^{2}+2^{2}$, by (i), $8 \in S$.
$9=3^{2}+0^{2}$, by (i), $9 \in S$.
$10=3^{2}+1^{2}$, by (i), $10 \in S$.
$6^{2}+8^{2}=10^{2}+0^{2}$, by (iii), $6 \in S$.
$11^{2}+2^{2}=10^{2}+5^{2}$, by (iii), $11 \in S$.
$13=2^{2}+3^{2}$, by (i), $13 \in S$.
$12^{2}+5^{2}=13^{2}+0^{2}$, by (iii), $12 \in S$.
$14^{2}+2^{2}=10^{2}+10^{2}$, by (iii), $14 \in S$.
$15^{2}+0^{2}=12^{2}+9^{2}$, by (iii), $15 \in S$.
Finally, prove that $S=\mathbf{N}$.
Use mathematical induction.
Assume $1,2, \cdots, 8 k-2,8 k-1,0 \in S$, by
$$
\begin{array}{l}
(8 k)^{2}+k^{2}=(7 k)^{2}+(4 k)^{2}, \\
(8 k+1)^{2}+(k-3)^{2}=(7 k-1)^{2}+(4 k+3)^{2}, \\
(8 k+2)^{2}+(k-1)^{2}=(7 k+1)^{2}+(4 k+2)^{2}, \\
(8 k+3)^{2}+(k+1)^{2}=(7 k+3)^{2}+(4 k+1)^{2}, \\
(8 k+4)^{2}+(k+3)^{2}=(7 k+5)^{2}+(4 k)^{2}, \\
(8 k+5)^{2}+k^{2}=(7 k+4)^{2}+(4 k+3)^{2}, \\
(8 k+6)^{2}+(k+2)^{2}=(7 k+6)^{2}+(4 k+2)^{2}, \\
(8 k+7)^{2}+(k+4)^{2}=(7 k+8)^{2}+(4 k+1)^{2},
\end{array}
$$

and (iii), we know $8 k, 8 k+1, \cdots, 8 k+7 \in S$, where $k \geqslant 2$.
And we already have $1,2, \cdots, 15,0 \in S$, then $S=\mathbf{N}$.
Therefore, for all non-negative integers $n, f(n)=n$.