Example 11 The set of all positive integers can be divided into two disjoint subsets of positive integers $\{f(1), f(2), \cdots, f(n), \cdots\},\{g(1), g(2), \cdots, g(n), \cdots\}$, where $f(1)<f(2)<\cdots<f(n)<\cdots g(1)<$ $g(2)<\cdots<g(n)<\cdots$ and $g(n)=f[f(n)]+1(n \geqslant 1)$. Find $f(240)$.
Let's first prove the following three equations:
$$
\begin{array}{l}
g(n)=f(n)+n, \\
f[f(n)]=f(n)+n-1, \\
f[f(n)+1]=f(n)+n+1,
\end{array}
$$

In fact, assuming $f(n)=k$, then $g(n)=f(k)+1$. Thus, the two disjoint sets $\{f(1), f(2), \cdots, f(k)\}$ and $\{g(1), g(2), g(3), \cdots, g(n)\}$ contain all natural numbers from 1 to $g(n)$. By counting the number of elements in these two sets, we get $g(n)=k+n$, i.e., $g(n)=f(n)+n$. Hence, equation (1) holds.
Furthermore, from $k+n=g(n)=f(k)+1$, we get $f(k)=k+n-1$, i.e., $f[f(n)]=f(n)+n-1$. Hence, equation (2) holds.
Let $F=\{f(n)\}$ and $G=\{g(n)\}$, for $n=1,2,3, \cdots$.
From the equation $g(n)-1=f[f(n)]$, we know that $g(n)-1$ is an element of $F$.
Therefore, it is impossible for two consecutive integers to both be elements of $G$.
Since $k+n$ is an element of $G$, $k+n-1$ and $k+n+1$ are both elements of $F$ and are consecutive elements of $F$. By equation (2), $f[f(n)+1]=k+n+1$, i.e.,
$f[f(n)+1]=f(n)+n+1$. Hence, equation (3) holds.
Next, we use equations (1), (2), and (3) to find $f(240)$ step by step.
In fact, from $g(1)=f[f(1)]+1>1$, we get $f(1)=1$, thus $g(1)=2$. From equation (3), we get $f(2)=f[f(1)+1]=f(1)+1+1=3$,
From equation (2), we get $f(3)=f(f(2))=f(2)+2-1=4$,
$f(4)=f(f(3))=f(3)+3-1=6$,
$f(6)=f(f(4))=f(4)+4-1=9$,
$f(9)=f(f(6))=f(6)+6-1=14$,
$f(14)=f[f(9)]=f(9)+9-1=22$,
$f(22)=f[f(14)]=f(14)+14-1=35$,
$f(35)=f[f(22)]=f(22)+22-1=56$,
$f(56)=f[f(35)]=f(35)+35-1=90$,
From equation (3), we get $f(91)=f[f(56)+1]=f(56)+56+1=147$,
$f(148)=f[f(91)+1]=f(91)+91+1=239$,
$f(240)=f[f(148)+1]=f(148)+148+1=388$.