Limit of the function $(\cos{\pi x})^{2n}$ as $n\to\infty$ I just came across this question. Kindly point out where I am wrong.

Finding $\lim (\cos{\pi x})^{2n}$

What I did :  $((\cos{\pi x})^2)^n$, then made $3$ categories, $x\lt 0$, $x\gt 0$ and $x=0$.
but due to the "square" it reduces to only $2$.
we know $\cos{\pi n} = (-1)^n$ so squaring gives the value as $1$.
thus $\lim (\cos{\pi x})^2n = (1)^n$ . Taking limit to infinity , thus equals $1$.
Is this correct ?
 A: Let $\displaystyle \lim_{n\to \infty} \left[\cos(\pi x)\right]^{2n} = L$. Then,
$$\begin{align} L & = \lim_{n\to\infty} \left[\cos(\pi x)\right]^{2n}\\
                   \ln(L) & = \lim_{n\to\infty} \ln\left[\cos(\pi x)\right]^{2n}\\
                          & = \lim_{n\to\infty}2n\ln\left[\cos(\pi x)\right] \\
                          & = \ln\left[\cos(\pi x)\right]\lim_{n\to\infty}2n \\                        
\end{align}$$
We know that $\cos(\pi x) \in [-1, 1]$, so choose $x$ such that $\frac{1}{2}(4n - 1) < x < \frac{1}{2}(4n + 1)$ where $n \in \mathbb{Z}$ so that $\cos(\pi x) \in (0, 1]$ (because natural log cannot accept negative input). This will mean that $\ln[\cos(\pi x)] \leq 0$. When $\ln[\cos(\pi x)] < 0$,
$$\begin{align} e^{\ln(L)} & = e^{-\xi\lim_{n\to\infty}2n} \\ L & = 0.\end{align}$$ If $\ln[\cos(\pi x)] = 0,$ then $\cos(\pi x) = 1$ and the proof is trivial, yielding $L = 1$.
A: You analysis seems to be correct for values of $x \in \mathbb{Z}$ but what about the other values? There are a number of symmetries that appear in the function, so if you don't want to see the full answer I suggest skimming through my answer and filling in the details on your own.
We are interested in the limit of the function sequence defined by
$$f_n (x) = \cos(\pi x)^{2n}$$
The power of 2 actually simplifies the limit as we can write the function as
$$ f_n(x) = \left[\cos^2{(\pi x)}\right]^n \geq 0$$
To my eye the only values of $x$ we are truly interested in is $x \in [0,1]$. For instance if we consider $x = 1 + \varepsilon, \ \varepsilon > 0$ then we would have
$$ \left[\cos^2{(\pi (1 + \varepsilon))}\right]^n = \left[\cos^2{(\pi \varepsilon)}\right]^n$$
You may also note that
$$ f_n [0,1] = f_n [-1,0]$$
So there is an evident symmetry in the function. Now if $x = m, \ m \in \mathbb{Z}$ we have
$$ f_n (x) = 1 \implies f_n (x) \to 1$$
If $x \in (0,1) + \mathbb{Z} = \mathbb{R} \setminus \mathbb{Z}$ we have
$$ \left[\cos^2{(\pi x)}\right]^n < 1 \implies f_n (x) \to 0$$
So we find in the end that
$$f_n (x) \to f(x), \ f(x) = \begin{cases} 0, \ x \in \mathbb{R} \setminus \mathbb{Z} \\ 1, \ x \in \mathbb{Z}\end{cases}$$
