How to prove that if $f$ is continuous a.e., then it is measurable. Definition of simple function


*

*$f$ is said to be a simple function if $f$ can be written as
$$f(\mathbf{x}) = \sum_{k=1}^{N} a_{_k} \chi_{_{E_k}}(\mathbf{x})$$
where $\{a_{_k}\}$ are distinct values for $k=1, 2, \cdots, N$ and
$\chi_{_{E_k}}(\mathbf{x})=\cases{1&if $\mathbf{x}\in E_k$\\0&if
$\mathbf{x}\notin E_k$}$.



Theorem $(4.12)$


*If $\{f_k\}$, is a sequence of measurable functions, then
$\displaystyle\limsup_{k\to\infty}f_k$ and
$\displaystyle\liminf_{k\to\infty}f_k$ are measurable. In particular
if $\displaystyle\lim_{k\to\infty}f_k$ exists a.e., it is
measurable.



Theorem $(4.13)$


*Every function $f$ can be written as the limit of a sequence
$\{f_k\}$ of simple functions.



Problem

If $f(x)$, $x\in\mathbb{R}^1$, is continuous at almost every point of an interval $[a, b]$, show that $f$ is measurable on $[a, b]$. Generalize this to functions defined in $\mathbb{R}^n$.
[For a constructive proof, use the subintervals of a sequence of partitions to define a sequence of simple measurable functions converging to $f$ a.e. in $[a, b]$. Use $(4.12)$.]




*

*By the theorem $(4.13)$, we can choose $\{f_k\}$, which are simple functions defined on $[a, b]$ and approaching to $f$. That is, choose $\{f_k\}$ such that, for $k=1, 2, \cdots$, 
$$f_k=\sum_{i=1}^{N} a_{_i}^{(k)} \chi^{(k)}_{_{E_i}} \quad \text{and} \quad \displaystyle\lim_{k\to\infty}f_k=f$$

*Since $f$ is continuous a.e., $f_k$ are measurable for all $k\in\mathbb{N}$.

*Then, by the theorem $(4.12)$, $f$ is measurable.



Q1) Why are $f_1, f_2, \cdots, f_N$ all measurable?
Q2) Morever, if $f_k$ are all measurable, then how can I ensure that $\displaystyle \lim_{k\to\infty}f_k$ exists? Is it ensured by theorem $(4.13)$?

If there is any advice or other proofs, please let me know them. Thank you.


Suppose $f: [a,b]\to \mathbb R$ is continuous at a.e. point of $[a,b].$ Let $D$ be the set of points of discontinuity of $f$ in $[a,b].$ Then $m(D)=0.$ We therefore have $E = [a,b]\setminus D$ measurable, and $f$ is continuous on $E.$
Let $c\in \mathbb R.$ Then
$$\tag 1 f^{-1}((c,\infty)) = [f^{-1}((c,\infty))\cap E] \cup [f^{-1}((c,\infty))\cap D].$$
Because $f$ is continuous on $E,$ the first set on the right of $(1)$ is open in $E.$ Thus it equals $E \cap U$ for some $U$ open in $\mathbb R.$ Because $E,U$ are both measurable, so is $f^{-1}((c,\infty))\cap E.$ And because $m(D) = 0,$ any subset of $D$ is measurable. It follows that $(1)$ is the union of two measurable sets, hence is measurable, and we're done.
