Showing that if $f=g$ a.e. on a general measurable set (for $f$, $g$ continuous), it is not necessarily the case that $f=g$. 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$.

 A: I am not normally a cat person but this one and I are old friends now.
So I think I should jump into the litter box and complete the task we have been set.   What is the definitive answer to this problem that was apparently given to all the kittys in a graduate class somewhere?  Here is a way to formulate and answer the problem.

Definition.  A set $E$ of real numbers is said to be a purrfect set if
  whenever $f$, $g:E\to R$ are continuous functions and $N\subset E$ is
  a set of Lebesgue measure zero for which $f(x)=g(x)$ for all $x\in
  E\setminus N$ it follows that $f(x)=g(x)$ for all $x\in E$.

Don't confuse purrfect with perfect.


*

*$[0,1]$ is a purrfect set [proved by J. Cat].

*$[0,1] \cup \{2\} $ is not a purrfect set [checked by J. Cat].

*Every open set is a purrfect set  [method of J. Cat works].

*Every set open in the density topology is a purrfect set.


Naturally the problem is not complete until we characterize purrfect sets.  The following does the job giving a paw-sitive solution to the originally posed problem.

Theorem. A necessary and sufficient condition for a set of real
  numbers $E$ to be a purrfect set is that for each $x\in E$ and for
  each $\epsilon>0$  $$m(E\cap(x-\epsilon,x+\epsilon))>0$$ where $m$ is
  Lebesgue outer measure.

We can leave this as an exercise for all you Cool Cats since the methods should be clear. Note that purrfect sets are kind of thick and furry  at each point.
In case you think that purrfect sets might be of little interest and that the instructor who set the problem 
should be charged with animal cruelty let me leave you with another problem.

Problem.  Suppose that $F:R\to R$ is an everywhere differentiable
  function.  Show that the set $$\{x: a<F'(x)<b\}$$ is a purrfect set
  for any $a$ and $b$.

[My apologies: someone seems to have run my posting through the web site
Kittify hence all the cat puns.  Too late to edit them out.]
A: 
Now $E_0 = h^{-1}(\mathbb{R} \backslash \{0\})$ [...] Since $E_0$ is open and $m(E_0)=0$, it must be empty.

No, that's not correct. The continuity of $h$ gives that
$$U := h^{-1}(\mathbb{R} \backslash \{0\}) = \{x \in \mathbb{R}; g(x) \neq f(x)\}$$
is open. This set does not equal
$$E_0 = \{x \in E; g(x) \neq f(x)\} = U \cap E;$$
in particular $E_0$ does not need to be open (at least not in $\mathbb{R}$, it is open in $E$).
Just consider the following example: Set $E := \{0\} \cup [1,2]$ and
$$f(x) := \begin{cases}0, & x \leq 0,\\ x, & x \in [0,1], \\1, & x>1 \end{cases}$$
and $g := 1$. Obviously, $f:\mathbb{R} \to \mathbb{R}$ is continuous and $f=g$ almost everywhere on $E$. However,
$$E_0 = \{0\}$$
is not empty and $f|_E$ does not equal $1$.
A: My feline friend is getting confused (and no doubt frustrated) and has now posted a further variant on the problem.  Here is the best I can come up with for a short tutorial.  I hope it helps.
Do this problem first:

Suppose that $f$, $g:E \to R$ are continuous functions.  Let $D$ be a
  subset of $E$ and suppose that $f(x)=g(x)$ for each $x\in D$.  What
  are the necessary and sufficient conditions on $D$ in order to
  conclude that $f(x)=g(x)$ for all $x\in E$?

You can do this in a metric space, but it is enough just to assume $E$ is some set of real numbers and that these functions are continuous relative to the set $E$.  There is no measure theory here, no measurable sets, no measure zero sets.  
If you can't solve this problem, then don't even try the other problem about sets of measure zero since this one is a prerequisite!
In short, forget about measure theory for a while and review what you already have learned about continuous functions, dense sets, etc.
