# Are there Lebesgue-measurable functions non-continuous almost everywhere?

My intuition keeps telling me that being continuous Lebesgue-almost everywhere is highly restrictive and that being measurable is not. But I've not been able to come up with a not continuous a.e. function e.g. $[0,1] \longrightarrow \mathbb{R}$. So

• Are there not continuous a.e. functions?
• Are there Lebesgue-measurable ones?
-

Let $$f(x) = \left\{\begin{array}{ll} 0 & \text{if }x\in\mathbb{Q},\\ 1 & \text{if }x\notin\mathbb{Q}. \end{array}\right.$$ Then $f(x)$ is Borel- (hence Lebesgue-) measurable, since $\mathbb{Q}$ is countable; it is also discontinuous everywhere, hence almost everywhere not continuous.

Regarding the comments made below, we have

Lusin's Theorem. If $f\colon [a,b]\to\mathbb{C}$ is measurable, then for every $\epsilon\gt 0$ there exists a compact $E\subseteq [a,b]$ such that $f|_E$ is continuous and $\mu(E^c)\lt\epsilon$.

This is the best you can hope for, as for instance the characteristic function of a fat Cantor set shows, as noted in this previous question.

-
As this example shows, one needs to be careful. "Continuous a.e." (i.e. the set of discontinuities has measure 0) is most definitely not the same as "equal to a continuous function a.e." – kahen Sep 23 '11 at 20:14
Ah, well as @kahen said I meant not a.e. equal to a continuous function. I'll post the appropriate question. Good point though :) – Evpok Sep 23 '11 at 20:18
Just a typo : not a.e. equal... – Evpok Sep 23 '11 at 20:20
@Evpok: So you want an example of a function $f(x)$ that is (i) Lebesgue measurable; and (ii) not equal almost everywhere to a continuous function. Correct? – Arturo Magidin Sep 23 '11 at 20:21
@Evpok: You could just add the correction to this one... – Arturo Magidin Sep 23 '11 at 20:23