TITLE: Proving following holds for almost everywhere
QUESTION [7 upvotes]: I am studying real analysis and encountered this problem.

Prove that for almost everywhere $x\in\mathbb{R}$, $\lim_{n\rightarrow\infty}|\cos{nx}|^{\frac{1}{n}}=1$.

What theorem can I use to solve this problem? I don't know how to start. Thanks.

REPLY [3 votes]: Hint: Using the behavior of $sin x$ near $0$ prove the following: 
$$m(\{x \in [-\frac {\pi} 2,\frac {\pi} 2]: |\sin x| \leq (1-\epsilon)^{n}) \leq c((1-\epsilon)^{n})$$ for some finite constant $c$.
[$m$ denotes Lebesgue measure]. 
Change $x$ to $\frac {\pi} 2-x$ to see that 
$$m(\{x \in [0,\pi]: |\cos x| \leq (1-\epsilon)^{n}) \leq c((1-\epsilon)^{n})$$
Change $x$ to $nx$ to see  that 
$$m(\{x \in [0,n\pi]: |\cos (nx)| \leq (1-\epsilon)^{n}) \leq cn((1-\epsilon)^{n})$$
Let $A_n=\{x \in [0,N]: |\cos (nx)| \leq (1-\epsilon)^{n}\}$ With $N$ fixed. Then 
$$ \sum m(A_n)<\infty$$.
Let $A=\lim \sup A_n$ (which is the set of points which belong to infinitely many $A_n$'s]. Then $m(A)=0$. If $x \in [0,N]$ and $x \notin A$ then $|\cos (nx)| \geq c(1-\epsilon)^{n}$ for  $n$ sufficiently large (for any $\epsilon >0$) and hence $|cos (nx)|^{1/n} \to 1$. 
Finish the proof by noting that $N$ is arbitrary and cosine is an even function.