I am trying to answer the second part in this question:
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$?
Here is a counter example I found here Prob. 1, Chap. 3, in Royden's REAL ANALYSIS: If continuous functions $f$ and $g$ agree a.e. on $[a,b]$, then $f=g$ on $[a,b]$ :
The set $[0,1]\cup\{2\}$ is measurable. Let $f(x) = x$ for $x$ in this set, and let $g(x)= x$ for $x\in[0,1]$ and $g(2)=3.$ Then $f$ and $g$ agree almost everywhere on their domain, and both are continuous on that domain, but they don't agree everywhere.
My question is:
I know that the main idea that we used in the proof of the first part was "every nonempty open set in $E = [a,b]$ has positive measure", but I do not understand how by changing our $E$ to $[0,1] \cup \{2\}$ we broke this idea , could anyone explain this to me please?