3. 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, m+2, \cdots, m+n-1\}$, there are at least 3 pairwise coprime elements.
For $n \geqslant 4$, for the set $M=\{m, m+1, m+2, \cdots, m+n-1\}$, if $2 \mid m$, then $m+1, m+2, m+3$ are pairwise coprime; if $2 \nmid m$, then $m, m+1, m+2$ are pairwise coprime. Thus, in all $n$-element subsets of $M$, there are at least 3 elements that are pairwise coprime, so $f(n)$ exists, and $f(n) \leqslant n$. Let $T_{n}=\{t \mid t \leqslant n+1$ and $2 \mid t$ or $3 \mid t\}$, it is known that $T_{n}$ is a subset of $\{2,3, \cdots, n+1\}$, but any 3 elements in $T_{n}$ cannot be pairwise coprime, so $f(n) \geqslant\left|T_{n}\right|+1$. By the principle of inclusion-exclusion, we get $\left|T_{n}\right|=\left[\frac{n+1}{2}\right]+\left[\frac{n+1}{3}\right]-\left[\frac{n+1}{6}\right]$, thus it must be that $f(n) \geqslant\left[\frac{n+1}{2}\right]+\left[\frac{n+1}{3}\right]-\left[\frac{n+1}{6}\right]+1$. Therefore, $f(4) \geqslant 4, f(5) \geqslant 5, f(6) \geqslant 5, f(7) \geqslant 6, f(8) \geqslant 7, f(9) \geqslant 8$.

Below, we prove that $f(6)=5$. Let $x_{1}, x_{2}, x_{3}, x_{4}, x_{5}$ be 5 numbers in $\{m, m+1, m+2, m+3, m+4, m+5\}$. If these 5 numbers include 3 odd numbers, then they are pairwise coprime;

If these 5 numbers include 2 odd numbers and 3 even numbers, without loss of generality, let $x_{1}, x_{2}, x_{3}$ be even, and $x_{4}, x_{5}$ be odd. Since $m, m+5$ have different parities, when $1 \leqslant i<j \leqslant 3$, we have $\left|x_{i}-x_{j}\right| \in\{2,4\}$, so at most one of $x_{1}, x_{2}, x_{3}$ is divisible by 3, and at most one is divisible by 5. Thus, at least one is neither divisible by 3 nor by 5, let's say it is $x_{3}$, then $x_{3}, x_{4}, x_{5}$ are pairwise coprime. Therefore, these 5 numbers must have 3 that are pairwise coprime, i.e., $f(6)=5$.
Since $\{m, m+1, \cdots, m+n\}=\{m, m+1, \cdots, m+n-1\} \bigcup\{m+n\}$, we have $f(n+1) \leqslant f(n)+1$.

Combining $f(6)=5$, we get $f(4)=4, f(5)=5, f(7)=6, f(8)=7, f(9)=8$.
Thus, for $4 \leqslant n \leqslant 9$, $f(n)=\left[\frac{n+1}{2}\right]+\left[\frac{n+1}{3}\right]-\left[\frac{n+1}{6}\right]+1$.
Below, we use induction to prove that for all $n \geqslant 4$, (2) holds.
Assume that for $n \leqslant k(k \geqslant 9)$, (2) holds, then for $n=k+1$, since
$\{m, m+1, \cdots, m+k\}=\{m, m+1, \cdots, m+k-6\} \bigcup\{m+k-5, \cdots, m+k\}$, noting that for $n=6, n=k-5$ (2) holds, so $f(k) \leqslant f(k-5)+f(6)-1$ $=\left[\frac{k-4}{2}+3\right]+\left[\frac{k-4}{3}+2\right]-\left[\frac{k-4}{6}+1\right]+1=\left[\frac{k+2}{2}\right]+\left[\frac{k+2}{3}\right]-\left[\frac{k+2}{6}\right]+1$, combining (1) we get that for $n=k+1$, (2) also holds.
In summary, for integers $n \geqslant 4$, we have $f(n)=\left[\frac{n+1}{2}\right]+\left[\frac{n+1}{3}\right]-\left[\frac{n+1}{6}\right]+1$. Note: $f(k) \leqslant f(k-5)+f(6)-1$ means that as long as one of the two sets has 3 elements that are pairwise coprime, it is sufficient.