5 Mathematical Induction
Mathematical induction can be used to solve function problems on the set of natural numbers.

Example 6 Find all functions $f: Z_{+} \rightarrow Z_{+}$, such that for any positive integer $n$, we have
$$
f(f(f(n)))+f(f(n))+f(n)=3 n \text {. }
$$
(2008, Dutch National Team Selection Exam)
If $f(m)=f(n)$, then
$$
3 m=3 n \Rightarrow m=n \text{. }
$$

Thus, $f$ is injective.
Next, we prove by induction on $n$ that:
$$
f(n)=n \text{. }
$$
(1) When $n=1$, since $f$ is a function from $\mathbf{Z}_{+} \rightarrow \mathbf{Z}_{+}$, we have $f(1) \geqslant 1$.
Therefore, $f(f(1)) \geqslant 1, f(f(f(1))) \geqslant 1$.
Also, $f(f(f(1)))+f(f(1))+f(1)=3$, so $f(1)=f(f(1))=f(f(f(1)))=1$.
(2) Suppose $k \geqslant 2$, and for $n<k$, $f(n)=n$.
By the injective property, for all $m(m \geqslant k)$, we have $f(m) \geqslant k$.
In particular,
$$
f(k) \geqslant k, f(f(k)) \geqslant k, f(f(f(k))) \geqslant k \text{. }
$$

From (1), we know
$$
f(f(f(k)))+f(f(k))+f(k)=3 k \text{. }
$$

Thus, $f(k)=f(f(k))=f(f(f(k)))=k$.
In conclusion, $f(n)=n$ for all $n \in \mathbf{Z}_{+}$.
Upon verification, $f(n)=n$ is a solution to the original equation.