TITLE: Prove a set is measurable
QUESTION [5 upvotes]: Let $n_1 < n_2 < \cdots$ be an infinite strictly increasing sequence of positive integers. Show that $\{x \in [0, 2\pi]: \{\cos(n_kx)\}_k^\infty \text{ converges}\}$ is measurable. I honestly have no idea how to approach this. Should I use the definition of measurable sets? Should I use the fact that $\cos$ is a measurable function? Should I somehow reduce the problem to a bunch of open sets? Or something else?
In general, how would one go about proving that a set is measurable? Thank you very much!

REPLY [8 votes]: We will show that the set is in fact Borel. To do this, we need to describe the set by means of countable unions, countable intersections, and complements, starting with basic sets (say, open, or closed). 
The key is that a sequence converges iff it is Cauchy. This allows us to avoid talking about the possible limit of the sequence. Hence, $\cos(n_k x)$ converges as $k\to\infty$ iff for all $\epsilon>0$ there is an $N$ such that whenever $a>b>N$ are integers, we have $|\cos(n_a x)-\cos(n_b x)|\le\epsilon$. We are almost there, but the mention of $\epsilon$ is a bit of a problem (there are too many possible $\epsilon$, and we only have "countable" resources). 
The next observation is that we really only need to talk about countably many $\epsilon$, namely, those of the form $1/k$ for $k$ a positive integer. Hence, $\cos(n_k x)$ converges iff for all $k$ there is an $N$ such that for all $a>b>N$ we have $|\cos(n_a x)-\cos(n_b x)|\le1/k$.  The last inequality can be expressed as saying that $x$ is in the pre-image of $[0,1/k]$ under some continuous function, namely, the function $f_{a,b}$ given by $f_{a,b}(t)=|\cos(n_a t)-\cos(n_b t)|$.
Now we just put all this together: The set we want is 
 $$ \bigcap_{k>0}\bigcup_{N\ge0}\bigcap_{a>b>N}A_{a,b,k}, $$
where $A_{a,b,k}=[0,2\pi]\cap f_{a,b}^{-1}([0,1/k])$. Note that $A_{a,b,k}$ is a closed set for all $a,b,k$, and the intersection of closed sets is closed, so we have expressed our set as a countable intersection of countable unions of closed sets, hence as a Borel set, and therefore measurable. 
This is a standard trick in descriptive set theory: Instead of an arbitrary $\forall \epsilon$, we try to write a "countable" version: $\forall k$. To say that $x$ satisfies a condition for all $k$ means that $x$ is in the intersection of countably many sets: The set of points that satisfy the condition when $k=1$, the set of points that satisfy the condition when $k=2$, etc. Similarly, we try to replace all arbitrary $\exists t$ with "countable" versions $\exists M$. To say that there is an $M$ for which $x$ satisfies a condition means that $x$ belongs to a countable union: The union of the set of points that satisfy the condition when $M=1$, the set of points that satisfy the condition when $M=2$, etc. This way, what we did was to move from a description involving quantifiers to an explicit recipe for building a Borel set. In practice, any sufficiently explicit description of a set ought to lead us to a Borel set or something very close to a Borel set by following this approach. In particular, the sets we obtain are measurable.

Let me add that the set is in fact null. Actually, if $a_1<a_2<\dots$ are any real numbers diverging to infinity (not necessarily integers), then $A=\{x\in\mathbb R\mid \lim_n\cos(a_nx)$ exists$\}$ has measure zero. I include a brief sketch: It follows from the Lemma of Riemann and Lebesgue stating that 
$$\lim_{|\lambda|\to\infty}\int_\mathbb R g(x)\sin(\lambda x)\,dx=0 $$
for any integrable $g$, that if $f(x)=\lim_n\chi_A\cos(a_n x)$, then $\int_B f=0$ for any measurable set $B$ of finite measure. From this it follows that $f=0$ a.e. Finally, using the lemma again, we get that for $B$ measurable of finite measure, $$\int_B f^2=\frac12\mu(A\cap B),$$
where $\mu$ denotes Lebesgue measure. But this means that $\mu(A\cap B)=0$. Since $B$ was arbitrary, we conclude that $\mu(A)=0$. Naturally, the same conclusion holds with $A'=\{x\in\mathbb R\mid \lim_n\sin(a_nx)$ exists$\}$ in place of $A$.