How to prove that if $f$ is continuous a.e., then it is measurable.
Solution 1:
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.