Example 4 Try to find the maximum value of the function
$$
y(x)=|\cos x+\alpha \cos 2x+\beta \cos 3x|
$$

among all $\alpha$ and $\beta$.
(49th Moscow Mathematical Olympiad)
Solution: For all $\alpha$ and $\beta$, we have
$$
\begin{array}{l}
\max y(x) \geqslant \max \left\{y\left(\frac{\pi}{6}\right), y\left(\frac{5 \pi}{6}\right)\right\} \\
=\max \left\{\left|\frac{\sqrt{3}}{2}+\frac{\alpha}{2}\right|,\left|-\frac{\sqrt{3}}{2}+\frac{\alpha}{2}\right|\right\} \\
\geqslant \frac{1}{2}\left(\left|\frac{\sqrt{3}}{2}+\frac{\alpha}{2}\right|+\left|-\frac{\sqrt{3}}{2}+\frac{\alpha}{2}\right|\right) \\
\geqslant \frac{1}{2}\left|\left(\frac{\sqrt{3}}{2}+\frac{\alpha}{2}\right)-\left(-\frac{\sqrt{3}}{2}+\frac{\alpha}{2}\right)\right|=\frac{\sqrt{3}}{2} .
\end{array}
$$

When $\alpha=0, \beta=-\frac{1}{6}$, we have
$$
\begin{array}{l}
y^{2}(x)=\left(\cos x-\frac{1}{6} \cos 3 x\right)^{2} \\
=\frac{\cos ^{2} x}{36}\left(9-4 \cos ^{2} x\right)^{2} \\
=\frac{1}{36 \times 8}\left(8 \cos ^{2} x\right)\left(9-4 \cos ^{2} x\right)\left(9-4 \cos ^{2} x\right) \\
\leqslant \frac{1}{36 \times 8} \times\left(\frac{18}{3}\right)^{3}=\frac{3}{4},
\end{array}
$$

i.e., $\max y(x)=y\left(\frac{\pi}{6}\right)=\frac{\sqrt{3}}{2}$.
Therefore, $\min _{\alpha, \beta} \max _{x} y(x)=\frac{\sqrt{3}}{2}$.
Comment: First, consider $\alpha$ and $\beta$ as constants, find the maximum value of $y(x)$, then consider $\alpha$ and $\beta$ as variables, find the minimum value among these maximum values.