Definition of measurable set: A set $E$ measurable if $$m^*(T) = m^*(T \cap E) + m^*(T \cap E^c)$$ for every subset of $T$ of $\mathbb R$.
Definition of Lebesgue measurable function: Given a function $f: D \to \mathbb R ∪ \{+\infty, -\infty\}$, defined on some domain $D \subset \mathbb{R}^n$, we say that $f$ is Lebesgue measurable if $D$ is measurable and if, for each $a\in[-\infty, +\infty]$, the set $\{x\in D \mid f(x) > a\}$ is measurable.
I have an example that a measurable function fails to be almost everywhere continuous. $f(x)$ is defined on $[0,1]$ with $$ \begin{eqnarray}f(x) = \begin{cases} 1, &x \in H,&\cr -1, &x \in ([0,1] - H) \end{cases} \end{eqnarray}$$ where $H$ is a Harnack set, an extension of cantor set, which is we throw open interval of length of $\frac{1}{4}$ centered in $[0,1]$ away and left $[0,\frac{3}{8}] \cup [\frac{5}{8}, 1]$; then throw open interval of length of $\frac{1}{4^2}$ centered in $[0,\frac{3}{8}]$ and $[\frac{5}{8},1]$ away respectively and left $[0, \frac{5}{32}] \cup [\frac{7}{32}, \frac{3}{8}]$ and $[\frac{5}{8}, \frac{25}{32}] \cup [\frac{27}{32}, 1]$; throw open interval of length of $\frac{1}{4^3}$ centered in each four closed interval above away and keep doing so on. The rest of $[0,1]$ at final is $H$. The total length of intervals that being throw away is $$\sum_{n=1}^{+\infty} 2^{n-1}(\frac{1}{4})^n = \frac{1}{2}$$.
So $f(x)$ is an obviously measurable function and fails to be continuous on $[0,1]$ or even, on a set $([0,1] - F)$ where $\forall F \in [0,1]$ is a null set.
But by Lusin's theorem: if $f(x)$ is a Lebesgue measurable function and finite almost everythere($m({x \in E: |f(x)| = +\infty}) = 0$), then $\forall \delta > 0$, $\exists$ closed set $F \subset [0,1]$, $m(E - F) < \delta$ such that $f(x)$ is a continuous function on $F$. So there does exist $F$ for this example but how to find a closed set $F \subset [0,1]$ if $\delta < \frac{1}{2}$ such that $f(x)$ is a continuous function on $F$?
Currently, I'm lost in my dilemma,
it seems that $H$ is a nowhere dense set with measure $\frac{1}{2}$. Do that mean H has interior which is so confusing?
if someone can find a closed set $F$ when $\delta < \frac{1}{2}$, it seems that $f$ being continuous on $F$ is actually piecewise continuous? Because the measure for either $f = 1$ or $f = -1$ is $\frac{1}{2}$ at most.
Update: I rethink question1 and $H$ is not a nowhere dense set. It does have interior inside. So can I claim a set with measure greater than $0$ contains some open interval?
A closed set $F$ such that $f$ is continuous on $F$ can be constructed as follows:
Take $\delta > 0$. In some step, the open intervals being removed have total measure smaller than $\delta/2$. Denote these open intervals by $I$.
Now, the function $f$ has only finitely many jumps on $[0,1]\setminus I$. Hence, you can find an open set $O$ with measure smaller than $\delta /2$ covering these points.
Now, set $F = [0,1] \setminus (I \cup O)$. Then, the measure of $[0,1] \setminus F$ is at most $\delta$. Moreover, $F$ is a finite union of closed intervals and $f$ is constant on each of these intervals.