3. The minimum value of the function $y=|\cos x|+|\cos 2 x|(x \in \mathbf{R})$ is $\qquad$ .
3. $\frac{\sqrt{2}}{2}$.

Let $t=|\cos x| \in[0,1]$, then $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} \text {. }
$$

We get $\frac{\sqrt{2}}{2} \leqslant y \leqslant 2$.
When $0 \leqslant t<\frac{\sqrt{2}}{2}$,
$$
y=-2 t^{2}+t+1=-2\left(t-\frac{1}{4}\right)^{2}+\frac{9}{8} \text {. }
$$

We get $\frac{\sqrt{2}}{2} \leqslant y \leqslant \frac{9}{8}$.
Thus, the minimum value of $y$ is $\frac{\sqrt{2}}{2}$.