Example 2 If the set $A=\{x \mid-2 \leqslant x \leqslant 5\}, B=\{x \mid m+1 \leqslant x \leqslant 2 m-1\}$ and $B \subseteq A$, find the set of values that $m$ can take.
Analysis We can use a number line as an auxiliary tool.
Solution When $m+1>2m-1$, i.e., $m<2$, $B=\varnothing$, satisfying $B \subseteq A$; if $B \neq \varnothing$, there should be $\left\{\begin{array}{l}m+1 \leqslant 2m-1 \\ m+1 \geqslant-2 \\ 2m-1 \leqslant 5\end{array}\right.$, i.e., $\left\{\begin{array}{l}m \geqslant 2 \\ m \geqslant-3, \\ m \leqslant 3\end{array}\right.$
Therefore, $2 \leqslant m \leqslant 3$, so $m<2$ or $2 \leqslant m \leqslant 3$,
which means the required set is $\{m \mid m \leqslant 3\}$.
Comment The empty set is a subset of any set; in problems involving subsets, be sure to pay attention to this special case.