Prove that $g=\limsup f_n$ and $h=\liminf f_n$ are Lebesgue measurable. Let $f_n:[0,1]\rightarrow\mathbb{R}$ be a sequence of continuous functions. Prove that $g=\limsup f_n$ and $h=\liminf f_n$ are Lebesgue measurable.
*Given $f_n$ being continuous on a compact set in $\mathbb{R}$, $f_n$ are Riemann integrable, thus, Lebesgue integrable. 
Note we can rewrite $g$ and $h$ as the following:
$g=\limsup f_n=\bigcap_{n\rightarrow\infty}\bigcup_{k\geq n}f_k$, where $k,n\in\mathbb{N}$. Since countable union/intersection of measurable functions are measurable by the definition of $\sigma$-algebra, $g$ therefore is Lebesgue measurable. 
Similarly, $h$ is measurable.
Is the above proof correct? Thank you.
 A: First we show that $g_1:=\sup_k f_k$ and $g_2 :=\inf_k f_k$ are measurable. Note that
$$g_1^{-1}(a,\infty] = \bigcup_k f_k^{-1}(a,\infty]
\quad\text{and}\quad
g_2^{-1}[-\infty,a) = \bigcup_k f_k^{-1}[-\infty,a)
$$
are measurable. Therefore the countable supremum and infimum of measurable functions are measurable. Consequently
$$
\limsup_k f_k = \inf_k(\sup_{j\geq k}f_j)
\quad\text{and}\quad
\liminf_k f_k = \sup_k(\inf_{j\geq k}f_j)
$$
are measurable functions.
A: We may define
$$ \limsup_{n\to\infty} a_n := \inf_{n\ge 1} \left( \sup_{k\ge n} a_k \right). $$
The function $\limsup_{n\to\infty} f_n$ is then defined pointwise by
$$ \left(\limsup_{n\to\infty} f_n\right) (x)
:= \limsup_{n\to\infty} \left( f_n(x) \right)
= \inf_{n\ge 1} \left( \sup_{k\ge n} f_k(x) \right).$$
If we can show that the functions
$$ g^{\wedge}(x) := \sup_{n\ge 1} g_n(x)
\qquad\text{and}\qquad
g^{\vee}(x) := \inf_{n\ge 1} g_n(x) $$
are measurable for any sequence $(g_n)$ of measurable functions, then we are done (do you see why?).  To do this, we need only show that the preimage of $(a,\infty)$ is measurable for any $a\in\mathbb{R}$.  But
\begin{align}
(g^{\wedge})^{-1}((a,\infty))
&= \bigcup_{n=1}^{\infty} (g_n)^{-1}((a,\infty)).
\end{align}
But each $g_n$ is measurable, so the union is a countable union of measurable sets, therefore measurable.  Hence $g^{\wedge}$ is measurable.  By a similar argument (replacing $(a,\infty)$ with $(\infty,a)$, for example), we can show that $g^{\vee}$ is measurable.  Now, define
$$f_n^{\wedge} := \sup_{k\ge n}f_k.$$
Each $f_n^{\wedge}$ is measurable by the above.  Then
\begin{equation}
\limsup_{n\to\infty} f_n
= \inf_{n\ge 1} \left( \sup_{k\ge n} f_n \right)
= \inf_{n\ge 1} f_{n}^{\wedge},
\end{equation}
which is the infimum of measurable functions, and therefore measurable.  The argument, mutatis mutandis, identical for the $\liminf$.
