Over the interval $[0,1]$, the function $f(x) = \cos(x)$ is a strictly decreasing continuous function mapping $[0,1]$ into itself. So $f\circ f$ is strictly increasing there. If one pick
$a_1 = \frac{\pi}{4} \in [0,1]$ and generate a sequence by iteration $a_n = f(a_{n-1})$,
it is not hard to check
$$a_2 < a_3 < a_1$$
Since $f$ is strictly decreasing, $a_2 < a_3 < a_1 \implies a_3 > a_4 > a_2$ and hence
$$a_2 < a_4 < a_3 < a_1$$
Since $f \circ f$ is strictly increasing, this implies the even sub-sequence $a_{2n}$ is strictly increasing and the odd sub-sequence $a_{2n-1}$ is strictly decreasing. Since all $a_k$ belongs to $[0,1]$, the even and odd sub-sequences are both bounded monotonic sequences. As a result, following two limits exists:
$$a_{even} = \lim_{n\to\infty} a_{2n}\quad\text{ and }\quad
a_{odd} = \lim_{n\to\infty} a_{2n-1}$$
Since $f\circ f$ is continuous, both $a_{even}$ and $a_{odd}$ are fixed points for $f \circ f$. If one make a plot of $f\circ f$ over the interval $[0,1]$, one will notice $f \circ f$ has a unique fixed point in $[0,1]$. That point is also the unique fixed point of $f$. This forces
$a_{even} = a_{odd}$ and the sequence $a_n$ converges to the unique fixed point of $f$.