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?

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$$
