Example 5 Given that the function $f(n)$ is defined on the set of positive integers and takes positive integer values, is strictly monotonically increasing, and satisfies $f[f(n)]=3n$, find the value of $f(2004)$.
Solution 1 From the problem, we know $f(n) \in \mathbf{N}^{+}$, and $f(3 n)=f[f[f(n)]]=3 f(n), n \in \mathbf{N}^{+}$.
First, find $f(1)$ and $f(2)$.
If $f(1)=1$, then $f(1)=f(f(1))=3$, which contradicts the monotonicity of $f(n)$.
From the problem, we have $f[f(1)]=3$. If $f(1) \geqslant 3$, then by strict monotonicity, we know $f(3)>f(2)>f(1) \geqslant 3$, thus $f(3)>5$, i.e., $f(f(1)) \geqslant f(3)>5$ which contradicts $f(f(1))=3$.
Therefore, $f(1)=2$.
In the condition $f[f(n)]=3 n\left(n \in \mathbf{N}^{+}\right)$, let $n=1$ to get $f[f(1)]=f(2)=3$.
Similarly, from the condition $f[f(n)]=3 n$, we can find
$$
f(3)=6, f(6)=9, f(9)=18, \cdots
$$

From this, we guess $f(n+1) \leqslant f(n)+3\left(n \in \mathbf{N}^{+}\right)$.
Therefore, we next prove that the above inequality holds.
Assume (2) is not true, i.e., there exists $n_{0} \in \mathbf{N}^{+}$ such that $f\left(n_{0}+1\right)>f\left(n_{0}\right)+3$, then from the problem
$3\left(n_{0}+1\right)=f\left[f\left(n_{0}+1\right)\right]>f\left[f\left(x_{0}\right)+3\right] \geqslant f\left[f\left(n_{0}\right)\right]+3=3 n_{0}+3$, which is a contradiction.
Therefore, (2) holds.
Finally, find $f(2004)$.
From (1) and (2), i.e., $f(1)=2, f(2)=3$, on one hand, we have
$$
\begin{aligned}
f(2004) & =3 \cdot f(668) \geqslant 3[f(669)-3]=3^{2} \cdot f(223)-9 \\
& \geqslant 3^{2}[f(225)-6]=3^{3} \cdot f(75)-63=3^{4} \cdot f(25)-63 \\
& \geqslant 3^{4}[f(27)-6]-63=3^{4} \cdot f\left(3^{3}\right)-549 \\
& =3^{4} \cdot 3^{3} \cdot f(1)-549=3^{7} \cdot 2-558=3825 .
\end{aligned}
$$

On the other hand, we have
$$
\begin{aligned}
f(2004) & =3 f(668) \leqslant 3[f(666)+6] \\
& =3 \cdot f\left(3^{2} \cdot 74\right)+18=3^{2} \cdot f(74)+18 \\
& \leqslant 3^{3} \cdot[f(72)+6]+18=3^{3} \cdot f\left(3^{3} \cdot 8\right)+180 \\
& =3^{5} \cdot f(8)+180 \leqslant 3^{5} \cdot[f(6)+6]+180 \\
& =3^{6} \cdot f(2)+6 \cdot 3^{5}+180=3^{6} \cdot 3+6 \cdot 3^{5}+180=3825 .
\end{aligned}
$$

Therefore, $f(2004)=3825$.
Solution 2 Similarly to Solution 1, we find $f(1)=2$. From $f(3 n)=f[f(f(n))]=3 f(n)\left(n \in \mathbf{N}^{+}\right)$, we know that when $k \in \mathbf{N}^{+}$, we have $f\left(3^{k}\right)=3^{k} \cdot f(1)=2 \cdot 3^{k}$.
From the above, we also have $f\left(2 \cdot 3^{k}\right)=f\left[f\left(3^{k}\right)\right]=3 \cdot 3^{k}=3^{k+1}$,
Therefore, for any $n \in \mathbf{N}^{+}$, we have $f\left(3^{n}\right)=2 \cdot 3^{n}, f\left(2 \cdot 3^{n}\right)=3^{n+1}$.
Also, $f\left(2 \cdot 3^{n}\right)-f\left(3^{n}\right)=3^{n+1}-2 \cdot 3^{n}=3^{n}=2 \cdot 3^{n}-3^{n}$.
Thus, when the variable increases from $3^{n}$ to $2 \cdot 3^{n}$, the function value increases from $2 \cdot 3^{n}$ to $3^{n+1}$. Noting that $f(n) \in \mathbf{N}^{+}$ and is strictly monotonically increasing, we know $f\left(3^{n}+m\right)=2 \cdot 3^{n}+m\left(0 \leqslant m \leqslant 3^{n}, m \in \mathbf{N}^{+}\right)$.
Thus, $f\left(2 \cdot 3^{n}+m\right)=f\left[f\left(3^{n}+m\right)\right]=3 \cdot\left(3^{n}+m\right)$.
Hence, $f(n)=\left\{\begin{array}{l}2 \cdot 3^{n}+m, \text { when } n=3^{k}+m, 0 \leqslant m \leqslant 3^{k} \text {, } \\ 3\left(3^{n}+m\right), \text { when } n=2 \cdot 3^{k}+m, 0 \leqslant m \leqslant 3^{k} \text {, }\end{array}\right.$
And $2004=2 \cdot 3^{6}+546$, then $f(2004)=f\left(2 \cdot 3^{6}+546\right)=3\left(3^{6}+546\right)=3825$.