8. The minimum value of $y=|\cos x|+|\cos 2 x|$ is

保留源文本的换行和格式，直接输出翻译结果。
8. $\frac{\sqrt{2}}{2}$ Detailed Explanation: Let $t=|\cos x| \in[0,1], y=t+\left|2 t^{2}-1\right|$,

When $\frac{\sqrt{2}}{2} \leqslant t \leqslant 1$, $y=2 t^{2}+t-1=2\left(t+\frac{1}{4}\right)^{2}-\frac{9}{8}$, we get $\frac{\sqrt{2}}{2} \leqslant y \leqslant 2$.
When $0 \leqslant t \leqslant \frac{\sqrt{2}}{2}$, $y=-2 t^{2}+t+1=-2\left(t-\frac{1}{4}\right)^{2}+\frac{9}{8}$, we get $\frac{\sqrt{2}}{2} \leqslant y \leqslant \frac{9}{8}$.
Since $y$ can take $\frac{\sqrt{2}}{2}$, the answer is $\frac{\sqrt{2}}{2}$.