# continuous almost everywhere versus equal to a continuous function almost everywhere

The concept of almost everywhere can be somewhat tricky to people who are not familiar with it. Let $m$ denote Lebesgue measure  . Consider the following two statements about a function $f\colon\mathbb{R}\to\mathbb{R}$:

Although these two statements seem alike, they have quite different meanings. In fact, neither one of these statements implies the other.

Consider the function $\chi_{[0,\infty)}(x)=\begin{cases}1&\text{if }x\geq 0\\ 0&\text{if }x<0.\end{cases}$

This function is not continuous at $0$, but it is continuous at all other $x\in\mathbb{R}$. Note that $m(\{0\})=0$. Thus, $\chi_{[0,\infty)}$ is continuous almost everywhere.

Suppose $\chi_{[0,\infty)}$ is equal to a continuous function almost everywhere. Let $A\subset\mathbb{R}$ be Lebesgue measurable (http://planetmath.org/LebesgueMeasure) with $m(A)=0$ and $g\colon\mathbb{R}\to\mathbb{R}$ such that $\chi_{[0,\infty)}(x)=g(x)$ for all $x\in\mathbb{R}\setminus A$. Since $\chi_{[0,\infty)}(x)=0$ for all $x<0$ and $m(A\cap(-\infty,0))=0$, there exists $a<0$ such that $g(a)=0$. Similarly, there exists $b\geq 0$ such that $g(b)=1$. Since $g$ is continuous, by the intermediate value theorem, there exists $c\in(a,b)$ with $g(c)=\frac{1}{2}$. Let $U=(0,1)$. Since $g$ is continuous, $g^{-1}(U)$ is open. Recall that $c\in g^{-1}(U)$. Thus, $g^{-1}(U)\neq\emptyset$. Since $g^{-1}(U)$ is a nonempty open set, $m(g^{-1}(U))>0$. On the other hand, $g^{-1}(U)\subseteq A$, yielding that $0, a contradiction   .

Now consider the function $\chi_{\mathbb{Q}}(x)=\begin{cases}1&\text{if }x\in\mathbb{Q}\\ 0&\text{if }x\notin\mathbb{Q}.\end{cases}$

Note that $m(\mathbb{Q})=0$. Thus, $\chi_{\mathbb{Q}}=0$ almost everywhere. Since $0$ is continuous, $\chi_{\mathbb{Q}}$ is equal to a continuous function almost everywhere. On the other hand, $\chi_{\mathbb{Q}}$ is not continuous almost everywhere. Actually, $\chi_{\mathbb{Q}}$ is not continuous at any $x\in\mathbb{R}$. Recall that $\mathbb{Q}$ and $\mathbb{R}\setminus\mathbb{Q}$ are both dense in (http://planetmath.org/Dense) $\mathbb{R}$. Therefore, for every $x\in\mathbb{R}$ and for every $\delta>0$, there exist $x_{1}\in(x-\delta,x+\delta)\cap\mathbb{Q}$ and $x_{2}\in(x-\delta,x+\delta)\cap(\mathbb{R}\setminus\mathbb{Q})$. Since $\chi_{\mathbb{Q}}(x_{1})=1$ and $\chi_{\mathbb{Q}}(x_{2})=0$, it follows that $\chi_{\mathbb{Q}}$ is not continuous at $x$. (Choose any $\varepsilon\in(0,1)$.)

Title continuous almost everywhere versus equal to a continuous function almost everywhere ContinuousAlmostEverywhereVersusEqualToAContinuousFunctionAlmostEverywhere 2013-03-22 15:58:47 2013-03-22 15:58:47 Wkbj79 (1863) Wkbj79 (1863) 10 Wkbj79 (1863) Example msc 28A12 msc 60A10