Let $f \colon \mathbb{R} \to \mathbb{R}$ be continuous almost everywhere, i.e. the set of all points where $f$ is not continuous has Lebesgue measure $0$ (1 dimensional Lebesgue measure). Call this set $E$. To prove that $f$ is measurable, take $U\subset \mathbb{R}$ open and look at $f^{-1}(U)$. This can be split up as follows
$$f^{-1}(U)= (f^{-1}(U)\cap E) \cup (f^{-1}(U) \cap E^c).$$
$f^{-1}(U)\cap E$ has measure 0 since it is a subset of $E$ which has measure $0$. Therefore $f^{-1}(U)\cap E$ is measurable. What about $f^{-1}(U) \cap E^c$ though? I know this is open in $E^c$ but this doesn't guarantee measurability. As far as I know it has to be open in $\mathbb{R}$, otherwise you can argue that the Vitali set is measurable since it is open in itself.
I don't know how to proceed further.