Proof verification: if $f,g: [a,b] \to \mathbb{R}$ are continuous and$f=g$ a.e. then $f=g$. Suppose $f$ and $g$ are continuous functions on $[a,b]$. Show that if $f=g$ a.e. on $[a,b]$, then, in fact, $f=g$ on $[a,b]$. Is a similar assertion true if $[a,b]$ is replaced by a general measurable set $E$?
OK. So here's my thought:
Set $A = \{ x \in [a,b]: f(x) \neq g(x)\}$, we're going to show that $A = \emptyset$.
We have $A = \{ x \in [a,b]: f(x) - g(x) \neq 0\} = [a,b] - \{ x \in [a,b]: f(x)-g(x)=0 \}=[a,b]-B$.
Since $f$ and $g$ both are continuous on $[a,b]$ the function $(f-g)(x)=f(x)-g(x)$ is well-defined on $[a,b]$ and is continuous. Therefore, since $B = (f-g)^{-1}(\{0\})$ and singletons are closed in a metric space, we conclude that $B$ is a closed set in $[a,b]$ and therefore $A$ is an open set in $[a,b]$.
The non-empty open sets in $[a,b]$ are one of these forms: $[a,x)$, $(x,b]$, $(x,y)$ or $[a,b]$ itself for $x<y \in (a,b)$ or we can have a union of these sets. The measure of all these sets is positive. Hence, contradiction. So, $A$ must be equal to the empty set. Q.E.D.
For the second part, if my proof is correct, then since I never used the fact that $[a,b]$ is closed, compact or any special set, I think we can generalize the proof to general measurable sets as long as they contain an open set.  Am  I right?
For example, if $E$ is the Cantor set, we can't generalize our proof to $E$.
Am I right?
I'm using the Lebesgue measure on $\mathbb{R}$. Whatever I say here is supposed to be true when we're using the Lebesgue measure on $\mathbb{R}$, not other possible measures.
 A: Your proof goes wrong here "The non-empty open sets in [a,b] are one of these forms: [a,x), (x,b], (x,y) or [a,b] itself..."
That statement about open sets is just wrong. For instance, the union of any two such sets is also open. What IS true is that every open set contains a set of one of those three types. And if it contains $[a, x)$, it also contains $( \frac{a+x}{2}, x)$. So it alwasy contains one of the third type, whose measure is positive. 
For your second part: what can you say about a measurable set that contains an open set? 
Also: would the statement be true if your set, was, say, the Cantor set $E$ together with the interval $(0, 0.1)$? Or do you need something MORE about open sets in relation to your set? 
A: Your description of the non-empty open sets is wrong, but you could easily correct your argument by saying that if $A\neq \emptyset$, then it contains an open ball thus it has positive measure.
Actually, a necessary and sufficient condition on a measurable set $E$ to satisfy your property is that every nonempty open set in $E$ has positive measure.
A: I think we can make the proof easier and with little (or basic) measure theory: suppose $\;w\in [a,b]\;$ is s.t. $\;f(w)\neq g(w)\;$ .
Since, as noted by you, the function $\;h(x):=(f-g)(x):=f(x)-g(x)\;$ is continuous and $\;h(w)\neq 0\;$ , there exists an open neighborhood $\;U_w\;$ of $\;w\;$, $\;U_w\subset [a,b]\;$ ( this is a one-sided open neighborhood if $\;w=a\;\;or\;\;w=b\;$) s.t. $\;h(x)\neq 0\;\;\forall\,x\in U_w\;$
But this can't be since this means $\;f(x)\neq g(x)\;\;\;\forall\,x\in U_w\;$ and $\;|U_w|>0\;$ .
A: Here is a direct proof for the first part (which is along the lines of Adam Hughes' comment):
Since $f=g$ ae, $\exists N\subseteq [a,b]: m(N)=0, \forall x\in N^c: f(x)=g(x)$. We claim that $f=g$ on $N$ also. Let $x\in N$. Observe that $N$ does not contain any open interval centered at $x$, otherwise it couldn't have zero measure. Then $\exists \{x_n\}_n\subseteq N^c: x_n\to x$. Since both $f$ and $g$ are continuous, $f(x_n)\to f(x)$ and $g(x_n)\to g(x)$. Since $f$ and $g$ coincide on $N^c$, $\forall n: f(x_n)=g(x_n)$, so that $f(x)=g(x)$.

For the second part, take $E:=\{0\}\subseteq\mathbb{R}, f(0):=1, g(0):=-1$. Then $m(\{f\neq g\})=m(E)=0$ and $f$ and $g$ are both continuous but $f\neq g$.
