Interesting counter-examples of relation between continuous and a.e. continuous function.

(a)$f$ is continuous a.e. on [0,1]

(b)There exists $g$ continuous on $[0,1]$ such that $g=f$ a.e.

How to prove that (a) $\nRightarrow$ (b) and (b) $\nRightarrow$ (a)?

I think it can be proved by counter examples.

Cantor function an example for (a) $\nRightarrow$ (b), is that right?

Then, I got stuck by the counter-example for (b) $\nRightarrow$ (a).

Could someone kindly help? Thanks!

• Why is the Cantor function an example for a does not imply b? The Cantor function is continuous everywhere, not just a.e., so automatically there exists a continuous g such that g=f a.e. – Ilham Apr 21 '15 at 3:34
• Your answers can be found here if you want: planetmath.org/… – Ilham Apr 21 '15 at 3:37

• The indicator function doesn't meet a requirement of being continuous or at least almost everywhere continuous, so it can not be an example of $f$ or $g$ in the problem formulation. How does it help to prove anything then? 3 minutes later: OK, got it, thanks. – CiaPan Apr 21 '15 at 9:11
Take any function with a single non-removable discontinuity. That is the simplest example, e.g., $f(x)=x, x<1/2 , f(x)=x+1 , x \geq 1/2$.
• To flesh out an argument for why there is no continuous function equal a.e. to your function: if $g$ is continuous and equal to $f$ a.e., then the preimage of $(1/2,3/2)$ is an open set, and it is nonempty by the intermediate value theorem (since there are points $x<1/2$ and $x>1/2$ such that $g(x)=f(x)$), so it has positive measure - but on this set $g(x)\ne f(x)$ since $f$ misses $(1/2,3/2)$, in contradiction to a.e. equality of $f$ and $g$. – Mario Carneiro Apr 21 '15 at 7:54