Questions of an example of a measurable function fails to be continuous everywhere or even, almost everywhere

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,

1. it seems that $H$ is a nowhere dense set with measure $\frac{1}{2}$. Do that mean H has interior which is so confusing?

2. 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?

• "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 ∀F∈[0,1] is a null set." The last part doesn't make much sense to me.
– zhw.
Jul 31, 2015 at 17:31
• @zhw.: Ohhh, not related to how to find a closed subset $F$. Yes, you are right. Jul 31, 2015 at 17:36

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.

• What did you mean by "the open intervals being removed have total measure smaller than $\frac{δ}{2}$"? How did you know $f$ has only finitely many jumps on [0,1]? Jul 31, 2015 at 21:52
• In step $n$ of the construction of the Harnack set, you remove $2^(i-1)$ intervals, each of length $1/4^i$. And this is smaller than $\delta /2$ for $i$ large enough. I did not say, that $f$ has finitely many jumps on $[0,1]$, but on $[0,1]\setminus I$.
– gerw
Aug 1, 2015 at 17:29
• You are right, amazed by your idea. Aug 2, 2015 at 20:56

If all you wanted was a measurable function which is nowhere continuous you could just say $f(x)=1$ for rational $x$, $f(x)=0$ for irrational $x$.

How to find a closed set verifying Lusin's theorem for the $f$ you constructed from that Harnack set? I doubt that anyone has any idea.

No, $H$ certainly has empty interior.

The last time you said something about piecewise continuity in regard to all this I said I didn't see how that made any sense. I still cannot make any sense out of question 2 above.

We know what it means to say $f$ is continuous at a point. And then saying $f$ is continuous on a set means that $f$ is continuous at every point of that set.

But saying $f$ is piecewise continuous only makes sense if $f$ is defined on an interval. And piecewise continuous does not imply continuous. Now here we have $f$ defined on an interval, but $f$ is not really the function we're talking about. Lusin says that $f|_F$ is continuous. Meaning it's continuous at every point of $F$. But saying $f|_F$ is piecewise continuous makes no sense. Or in any case I have no idea what you mean when you say that. It is continuous.

• I know what's wrong with my idea now. I mixed continuous up with piecewise continuous. Ok. But it is very funny that a set $H$ with no interior has measure greater than 0. I think it will be pretty hard to find a such closed set $F$ when $\delta < \frac{1}{2}$ in this case. Jul 31, 2015 at 17:47
• An example that may be less confusing, or maybe more so: Say $r_1,\dots$ is an enumeration of the rationals in $[0,1]$. Choose $\delta_n>0$ with $\sum2\delta_n<1$. Let $I_n=(r_n-\delta_n,r_n+\delta_n)$ and set $K=[0,1]\setminus\bigcup_n I_n$. Then $K$ obviously has empty interior since it contains no rational. Seems like $K$ must be empty since we removed an interval around each rational, but no, it's obvious that $m(K)>0$. (The reason it seems $K$ must be empty is bogus. Say $x$ is irrational. Then $|x-r_n|>0$ for all $n$, and if it just happens that $|x-r_n|>\delta_n$ then $x\notin K$.) Jul 31, 2015 at 17:57