Example 16 For integers $n \geqslant 4$, find the smallest integer $f(n)$, such that for any positive integer $m$, in any $f(n)$-element subset of the set $\{m$, $m+1, \cdots, m+n-1\}$, there are at least 3 pairwise coprime elements.
First, verify $f(4)=4, f(5)=5, f(6)=5$.
$n=4:\{m, m+1, m+2, m+3\}$, if $m$ is odd, then $m, m+1, m+2$ are pairwise coprime; if $m$ is even, then $m+1, m+2, m+3$ are pairwise coprime, hence $f(4) \leqslant 4$. However, in $\{m, m+1, m+2, m+3\}$, taking 2 even numbers and one odd number to form a 3-element subset, the 3 numbers cannot be pairwise coprime, so $f(4)=4$.
$n=5:\{m, m+1, m+2, m+3, m+4\}$, similarly to the case of $n=4$, $\{m, m+1, m+2, m+3, m+4\}$ must have 3 numbers that are pairwise coprime, hence $f(5) \leqslant 5$. But when $m$ is even, $m, m+2, m+4$ are all even, the 4-element subset $\{m, m+1, m+2, m+4\}$ does not contain 3 numbers that are pairwise coprime, so $f(5)=5$.
$n=6:\{m, m+1, m+2, m+3, m+4, m+5\}$ contains 3 odd numbers and 3 even numbers. If we take a 4-element subset with 3 even numbers and 1 odd number, there are no 3 numbers that are pairwise coprime, so $f(6)>4$. Considering a 5-element subset, if it contains 3 odd numbers, then these 3 numbers are pairwise coprime; if the 5 numbers are 3 even and 2 odd, since at most one of the 3 even numbers is a multiple of 3, and at most one is a multiple of 5, there must be 1 even number that is not divisible by 3 or 5. This number is pairwise coprime with the 2 odd numbers, so $f(6)=5$.
$n>6$: Let $T_{n}=\{t|t \leqslant n+1, 2| t$, and $3 \mid t\}$, then $T_{n}$ is a subset of $\left.\mid 2,3, \cdots, n+1\right\}$, and any 3 elements in $T_{n}$ cannot be pairwise coprime, so
$$
\begin{array}{l}
f(n) \geqslant\left|T_{n}\right|+1=\left[\frac{n+1}{2}\right]+\left[\frac{n+1}{3}\right]-\left[\frac{n+1}{6}\right]+1 . \\
\text { Let } n=6 k+r, k \geqslant 1, r=0,1,2,3,4,5, \text { then } \\
{\left[\frac{n+1}{2}\right]+\left[\frac{n+1}{3}\right]-\left[\frac{n+1}{6}\right]+1=4 k+\left[\frac{r+1}{2}\right]+\left[\frac{r+1}{3}\right]-\left[\frac{r+1}{6}\right]+1} \\
=\left\{\begin{array}{l}
4 k+r+1, r=0,1,2,3, \\
4 k+r, r=4,5 .
\end{array}\right.
\end{array}
$$

When $r=0,1,2,3$, divide the $n=6 k+r$ numbers into $k$ groups of $\{m, m+1, \cdots, m+5\},\{m+6, m+7, \cdots, m+11\}, \cdots,\{m+6(k-1), m+6(k-1)+1, \cdots, m+6 k-1\}$, and the remaining $r$ numbers $m+6 k, m+6 k+1, \cdots, m+6 k+r-1$. Taking any $4 k+r+1$ numbers, at least $4 k+1$ numbers belong to the first $k$ groups of 6 numbers. By the pigeonhole principle, there must be $\left[\frac{(4 k+1)-1}{k}\right]+1=5$ numbers in the same group, and by $f(6)=5$, these 5 numbers must contain 3 numbers that are pairwise coprime.

When $r=4,5$, similarly divide the $n=6 k+r$ numbers into groups. Taking any $4 k+r$ numbers, if $r=4,5$ numbers belong to the remaining $r$ numbers, then by $f(r)=r(r=4,5)$, these $r$ numbers must contain 3 numbers that are pairwise coprime. Otherwise, at least $4 k+1$ numbers belong to the first $k$ groups of 6 numbers, so there must be 5 numbers in the same group, and by $f(6)=5$, these 5 numbers must contain 3 numbers that are pairwise coprime.
Hence, $f(n)=\left[\frac{n+1}{2}\right]+\left[\frac{n+1}{3}\right]-\left[\frac{n+1}{6}\right]+1$.