Convergence of a sequence of functions involving rational and irrational numbers For each $n\in \mathbb N$, let $f_n(x)=lim_{m\rightarrow \infty} (cosn!\pi x)^{2m}$
Show that the sequence converges on $\mathbb R$ to the function $f$ defined by
$$f(x)=1, x\in \mathbb Q$$
$$=0, x\in \mathbb R- \mathbb Q$$
My attempt: I know that $cosx$ is bounded and $2m$ is even means the value has to be positive. So it can be between $0$ and $1$,
I don't know how to show the values are $0$ and $1$.
My guess waa to go with induction. But that works for only natural numbers. How to I prove it for rationals and irrationals then?
 A: Fix some $x \in \mathbb{Q}$. We then have $x = \frac{p}{q}$ with no common prime factors. If you take $n$ big enough, $n!$ will have $q$ as a factor, such as the factorial of every natural following $n$. Then, $\cos(n!\pi\frac{p}{q}) = cos(m\pi)$ for some even $m$ (can you see why?). Then, this $cos$ will be $1$ for every following $n$, which means that this sequence of functions, at some point, stays constant and equal to $1$, for every rational $x$. 
Fix now $x \in \mathbb{R-Q}$. Then, we can see that $n!x$ won't be an integer for every $n$. Therefore, you will have the cosine of something that is not an integer multiple of $\pi$. Then, this cosine will be less than $1$, and you'll have the powers of a number less than one, which will converge to $0$. Then, the functions will be constant and equal to $0$ for every $n$ (and $x$ irrational), which means that the sequence of functions will converge to it.
A: See if $x \in \Bbb Q$ then $x=\frac pq$  then $\exists$ $n \in \Bbb N$ s.t $q|n$ then $f_n(x)=lim_{m\rightarrow \infty} (cosn!\pi x)^{2m}=1$ [As $cos(2k\pi)=1, k\in \Bbb Z$]. $\forall n>N+2$.
if $x \in \Bbb R\setminus \Bbb Q$ then for a fixed $x, (cosn!\pi x)<1$. So $f_n(x)=lim_{m\rightarrow \infty} (cosn!\pi x)^{2m}=0$ $\forall n$.
So, $$f(x)=1, x\in \mathbb Q$$
$$=0, x\in \mathbb R- \mathbb Q$$
