Answer
See explanation
Work Step by Step
$$\lim\limits_{x \to \frac{\pi}{2}}\frac{\cos(mx)}{\cos(nx)}=\frac{\cos(m\cdot \frac{\pi}{2})}{\cos(n\cdot \frac{\pi}{2})}=\frac{0}{0}$$
Using the l'Hospital's rule it follows:
$$\lim\limits_{x \to \frac{\pi}{2}}\frac{(\cos(mx))'}{(\cos(nx))'}=\lim\limits_{x \to \frac{\pi}{2}}\frac{-m\sin(mx)}{-n\sin(nx)}=\lim\limits_{x \to \frac{\pi}{2}}\frac{m\sin(mx)}{n\sin(nx)}=\frac{m\sin(m \cdot \frac{\pi}{2})}{n\sin(n \cdot\frac{\pi}{2})}$$
If $m$ is even and $n$ is even, the limit is $(-1)^{(m-n)/2}$.
If $m$ is even and $n$ is odd, the limit does not exist.
If $m$ is odd and $n$ is even, the limit is $0$.
If $m$ is odd and $n$ is odd, the limit is $(-1)^{(m-n)/2\frac{m}{n}}$.