This is related to a question I just asked, that I now think was based on wrong assumptions.
It is true that if $f=a$ a.e. on the interval $[a,b]$, then $f = a$ on $[a,b]$. However, apparently it is not true for a general measurable set $E$ with $m(E) \neq 0$, which confuses me greatly.
I just finished the following proof which I thought showed that the statement was true for a general measurable set $E$. Apparently, it's not. Could somebody please tell me 1) what's wrong with it, 2) how to fix it, 3) how to use it to show that the statement is not true for $E$ with $m(E) \neq 0$ (or whichever kind of set it doesn't work for):
Suppose $f$ and $g$ are continuous on the general measurable set $E$. Suppose also that $E_{0}\subseteq E$ is the set of all points where $f \neq g$ are all contained (i.e., $\forall x \in E_{0}$, $f \neq g$), where $m(E_{0})=0$.
Consider $|h|=|f-g|$. $|h|$ is the composition of a continuous function and the linear combination of two continuous functions, so $|h|$ is continuous.
Now, $E_{0} = |h|^{-1}(\mathbb{R}\backslash\{0\})=h^{-1}((-\infty,0)\cup (0,\infty))$. $(-\infty,0)\cup(0,\infty)$ is a union of open sets and therefore open. Since $|h|$ is continuous, $E_{0}$ is also open.
Since $E_{0}$ is open and $m(E_{0})=0$, it must be empty (as otherwise, it must contain a nonempty interval, whose measure would be positive.
Therefore, since the set of points on which $f \neq g$ is empty, $f=g$ everywhere on $E$.