is this correct? $\lim\limits_{x\to a}f(x)^{g(x)} = [\lim\limits_{x\to a}f(x)]^{\lim\limits_{x\to a}g(x)}$
When $ \lim_{x\to a}f(x) > 0$ and $\lim_{x\to a} g(x)$ exsits, from the continuity of $\exp(x)$ and $\ln(x)$, we have $$ \lim_{x\to a} f(x)^{g(x)} = \lim_{x\to a} \exp({g(x)\cdot \ln f(x)}) = \exp \left(\lim_{x\to a} g(x) \cdot \ln \left(\lim_{x\to a}f(x)\right)\right) = \left[\lim_{x\to a}f(x)\right]^{\lim_{x\to a} g(x)} .$$
$\begin{array}\\ (\cos(x))^{-x^2} &=\exp(-x^2\ln(\cos(x)))\\ &=\exp(-x^2\ln(1-x^2/2+O(x^4)))\\ &=\exp(-x^2(-x^2/2+O(x^4)))\\ &=\exp(x^4/2+O(x^6))\\ &\to \exp(0)\\ &=1\\ \end{array} $
If you meant $(\cos(x))^{x^{-2}} $ then we get $\exp(x^{-2}(-x^2/2+O(x^4))) =\exp(-1/2+O(x^2)) \to e^{-1/2}$.