Here is Prob. 1, Chap. 3, in the book Real Analysis by H. L. Royden and P. M. Fitzpatrick, 4th edition:
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?
My Attempt:
Let $E_0$ be a subset of $[a, b]$ such that $m^* \left( E_0 \right) = 0$ and $f(x) = g(x)$ for all $x \in [a, b] \setminus E_0$.
What next? How to proceed from here?
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.