Example 4 In the positive integers not exceeding 2012, take $n$ numbers arbitrarily, so that there are definitely two numbers whose ratio is within the interval $\left[\frac{2}{3} ; \frac{3}{2}\right]$. Try to find the minimum value of $n$.


Solve for
$$
\begin{array}{l}
\{1,2,4,7,11,17,26,40,61,92,139, \\
209,314,472,709,1064,1597\}
\end{array}
$$

When any two numbers are taken, their ratio is either greater than $\frac{3}{2}$ or less than $\frac{2}{3}$.
Therefore, $n \geqslant 18$.
Next, we prove: When 18 numbers are taken, there exist two numbers whose ratio lies within the interval $\left[\frac{2}{3}, \frac{3}{2}\right]$.
Divide $1,2, \cdots, 2012$ into the following 17 sets:
$\{1\},\{2,3\},\{4,5,6\},\{7,8,9,10\}$,
$\{11,12, \cdots, 16\},\{17,18, \cdots, 25\}$,
$\{26,27, \cdots, 39\},\{40,41, \cdots, 60\}$,
$\{61,62, \cdots, 91\},\{92,93, \cdots, 138\}$,
$\{139,140, \cdots, 208\},\{209,210, \cdots, 313\}$,
$\{314,315, \cdots, 471\},\{472,473, \cdots, 708\}$,
$\{709,710, \cdots, 1063\}$,
$\{1064,1065, \cdots, 1596\}$,
$\{1597,1598, \cdots, 2012\}$.
In each of these 17 sets, the ratio $k$ of any two numbers satisfies
$$
\frac{2}{3} \leqslant k \leqslant \frac{3}{2} \text {. }
$$

By the pigeonhole principle, we know that from $1,2, \cdots, 2012$, if 18 numbers are arbitrarily selected, there must be two numbers from the same set, and their ratio lies within $\left[\frac{2}{3}, \frac{3}{2}\right]$.
In summary, the minimum value of $n$ is 18.