Is known that
$$2\cos^2a = 1+\cos 2a.$$
So
$$f(\theta) = \dfrac12\max\left(1+\cos2\theta,2-\left(1+\cos\left(\dfrac\pi2-2\theta\right)\right)\right),$$
$$f(\theta) = \dfrac12+\dfrac12\max(\cos2\theta,-\sin2\theta).$$
Since
$$\cos2\theta+\sin2\theta = \sqrt2\left(\sin\dfrac\pi4\cos2\theta+\cos\dfrac\pi4\sin2\theta\right) = \sqrt2\sin\left(2\theta+\dfrac\pi4\right),$$
then
$$f(\theta) =
\begin{cases}
\dfrac12+\dfrac12\cos2\theta,\quad\text{if}\quad
2\theta\in\left[2k\pi-\dfrac\pi4,2k\pi+\dfrac{3\pi}4\right]\\
\dfrac12-\dfrac12\sin2\theta,\quad\text{if}\quad
2\theta\in\left[2k\pi+\dfrac{3\pi}4,2k\pi+\dfrac{7\pi}4\right],
\end{cases}$$
where
$$k\in\mathbb Z.$$
If
$$2\theta\in\left(2k\pi-\dfrac\pi4,2k\pi+\dfrac{3\pi}4\right),$$
then
$$\min f(\theta) = \dfrac12-\dfrac{\sqrt2}4\quad\text{at}\quad 2\theta=2k\pi+\dfrac{3\pi}4.$$
If
$$2\theta\in\left[2k\pi+\dfrac{3\pi}4,2k\pi+\dfrac{7\pi}4\right],$$
then
$$\min f(\theta) = \dfrac12-\dfrac{\sqrt2}4\quad\text{at}\quad 2\theta=2k\pi+\dfrac{3\pi}4.$$
Therefore,
$$\boxed{\min f(\theta) = \dfrac12-\dfrac{\sqrt2}4\quad\text{at}\quad \theta=k\pi+\dfrac{3\pi}8.}$$