# If two functions are equal almost everywhere, the first is continuous a.e., is the second?

If $$f = g$$ a.e. in $$E \in \mathfrak{M}$$ (the Lebesgue measurable sets) and $$f$$ is continuous a.e. in $$E$$, is $$g$$ continuous a.e. in $$E$$?

I think this is true.

My “proof”:

Let us denote $$D_1 = \{ x \in E: f(x) \text{ discontinuous}\}$$, $$m(D_1) = 0$$ and $$D_2 = \{ x \in E: f(x) \neq g(x)\}$$, $$m(D_2) = 0$$.

Define $$D_3 = \{ x \in E: g(x) \text{ discontinuous}\}$$.

If $$f$$ is identically $$g$$, then it is clear that the result follows as $$D_3 = D_1$$.

Otherwise, we have $$D_3 \subseteq D_1 \cup D_2$$, and so $$m^*(D_3) \leq m^*(D_1 \cup D_2) \leq m^*(D_1) + m^*(D_2) = 0$$.

So, $$m(D_3) = 0$$ and hence $$g$$ is continuous almost everywhere.

Does this proof work?

Thanks!

Edit: for clarity, $$m$$ denotes the Lebesgue measure and $$m^*$$ the Lebesgue outer measure.

• How do you justify $D_3 \subseteq D_1 \cup D_2$ ? – Yves Daoust Dec 12 '18 at 20:46
• @YvesDaoust My reasoning was that if $f(x) = g(x)$ on $E\setminus D_1$ then since $f(x)$ is continuous there, $g(x)$ ought to be as well? – TuringTester69 Dec 12 '18 at 20:47
• Continuity of $f$ in $E\setminus D_1$ does not imply continuity of $g$, because of $D_2$. – Yves Daoust Dec 12 '18 at 20:51
• Consider the case where $f$ is identically 0, and $g$ is the characteristic function of the rationals. – Andrés E. Caicedo Dec 12 '18 at 20:52
• @Andrés E. Caicedo, you're absolutely right I was just about to fix my mistake with that example. That should be the answer. – James Yang Dec 12 '18 at 20:54

The claim is not true. An easy counterexample is obtained by letting $$f$$ be identically 0 and $$g$$ be the characteristic function of the rationals. We have $$f=g$$ a.e., $$f$$ is everywhere continuous and $$g$$ is nowhere continuous.

(Clearly, the restriction of $$g$$ to the irrationals is continuous (being constant), but this is not enough to ensure that $$g$$ is continuous on the irrationals.)

$$f$$ continuous on $$E\setminus D_1$$ implies $$f$$ continuous on $$E\setminus(D_1\cup D_2)$$. And of course, $$g$$ continuous on $$E\setminus(D_1\cup D_2)$$. Then the measure of $$D_3$$ is at most that of $$D_1\cup D_2$$.

• Not quite. The restriction of $g$ to a set $F$ may be continuous without $g$ itself being continuous on $F$. – Andrés E. Caicedo Dec 12 '18 at 20:57
• @AndrésE.Caicedo: what difference do you make between "restricted to $F$" and "on $F$" ?? – Yves Daoust Dec 12 '18 at 20:59
• The domain of $g$ restricted to $F$ is $F$. The domain of $g$ may be larger, and points not in $F$ may affect whether $g$ is continuous at some point in $F$. See my answer for an example. There, with $F$ the irrationals, $g|F$ is continuous because it is constant, but $g$, defined everywhere, is not continuous at any point. – Andrés E. Caicedo Dec 12 '18 at 21:02

No your proof does not work because the fact that $$f(x)=g(x)$$ on $$E\setminus D_1$$ implies $$g(x)$$ is continuous from the continuity of $$f(x)$$ tells you that:

$$D_2\cap (E \setminus D_1) \subseteq (E \setminus D_3)$$

which means:

$$D_3 \subseteq (E \setminus D_2) \cup D_1$$