Example 1 Write an $n$-digit number using the digits 1 or 2, where any two adjacent positions are not both 1. Let the number of $n$-digit numbers be $f(n)$. Find $f(10)$.
(Jiangsu Province Second Mathematical Correspondence Competition)
Solution: The $n$-digit numbers that meet the conditions can be divided into two categories:
I. The first digit is 2, then the number of $(n-1)$-digit numbers that meet the conditions is $f(n-1)$;
II. The first digit is 1, then the second digit should be 2, and the number of $(n-2)$-digit numbers is $f(n-2)$. Therefore,
$$
f(n)=f(n-1)+f(n-2) \text {. }
$$

Thus, $\{f(n)\}$ is the Fibonacci sequence.
$$
\begin{array}{l}
\because f(1)=2, \\
\therefore f(10)=144 .
\end{array}
$$

The key to solving this problem is to classify based on the first digit. If we generalize to 3 digits, the situation becomes more complex.