5. $f(\theta)=\frac{1-\sqrt{2} \sin \theta}{\sqrt{7-\left[6 \sin \left(\theta+\frac{\pi}{4}\right)+2 \cos \left(\theta+\frac{\pi}{4}\right)\right]}}$ The range of values is . $\qquad$
5. $\left[\frac{\sqrt{3}-\sqrt{8}}{5}, \frac{\sqrt{3}+\sqrt{8}}{5}\right]$.

Notice
$$
\begin{array}{l}
f(\theta)=\frac{1-\sqrt{2} \sin \theta}{\sqrt{7-\left[6 \sin \left(\theta+\frac{\pi}{4}\right)+2 \cos \left(\theta+\frac{\pi}{4}\right)\right]}} \\
=\frac{1-\sqrt{2} \sin \theta}{\sqrt{(-2+\sqrt{2} \cos \theta)^{2}+(-1+\sqrt{2} \sin \theta)^{2}}} . \\
\text { Let } \overrightarrow{O A}=(0,-1), \\
\overrightarrow{O B}=(-2+\sqrt{2} \cos \theta,-1+\sqrt{2} \sin \theta) . \\
\text { Then } f(\theta)=\frac{\overrightarrow{O A} \cdot \overrightarrow{O B}}{|\overrightarrow{O A}||\overrightarrow{O B}|}=\cos \langle\overrightarrow{O A}, \overrightarrow{O B}\rangle . \\
\text { Also, } A(0,-1) \text { is a fixed point, and } B \text { is a point on the circle with center }(-2,-1)
\end{array}
$$

and radius $\sqrt{2}$.
Therefore, by geometric knowledge, the range of $\cos \langle\overrightarrow{O A}, \overrightarrow{O B}\rangle$ is $\left[\frac{\sqrt{3}-\sqrt{8}}{5}, \frac{\sqrt{3}+\sqrt{8}}{5}\right]$.