I am studying Real analysis and I want to prove (or disprove) that (this is inspired by the fact that every continuous function is measurable)
Problem If $f:X\rightarrow \mathbb R$ is continuous a.e. then $f$ is measurable.
Applying the idea from this link I believe it is true only when $X$ is complete, where the space is complete here means that every subset of $D$ of measure zero in that measure space is measurable. Then $\mathbb R$ is complete since every subset of the set of Lebesgue measure zero $A$ must be measurable.
Q1 I am not sure if I understand this concept correctly. However, it seems false if $X$ is not complete and I use the example here (not sure if it is true please help me)
Let $Z\subset X$ be a measurable set of measure zero and $Z'\subset Z$ be a non-measurable subset of $Z$ (I don't know if there exists such space that this happens but I think it should exist for otherwise we may not need to use the "complete" term) and that $$f(x) = \cases{1 & , $x\in Z'$ \cr 0 & , $x\in(X\setminus Z)\cup (Z\setminus Z')$}$$ This function is continuous a.e. (on $X\setminus Z$) but $$\left\{x\in X; f(x)>\dfrac{1}{2}\right\}$$ is not measurable and $f$ is not a measurable function.
Q2 What about the proof when $X$ is complete here, I am trying to use the idea on that link so that I can understand myself. Let $D$ be the set of measure zero of $X$. Define $$f_1(x) = \cases{0 & , $x\in X\setminus D$ \cr f|_{D}(x) & , $x\in D$}$$ $$f_2(x) = \cases{0 & , $x\in D$ \cr f|_{X\setminus D}(x) & , $x\in X\setminus D$}$$ and each $f_1,f_2$ can be proven not hard that they are measurable functions (by using the fact that every subset of $D$ is measurable). Thus $f=f_1+f_2$ is measurable.