Real Analysis – Does $f(x)$ Continuous and $f = 0$ a.e. Imply $f=0$ Everywhere?

measure-theoryreal-analysis

I wanna prove that

"if $f: \mathbb{R}^n \to \mathbb{R}$ is continuous and satisfies $f=0$ almost everywhere (in the sense of Lebesgue measure), then, $f=0$ everywhere."

I am confident that the statement is true, but stuck with the proof. Also, is the statement true if the domain $\mathbb{R}^n$ is restricted to $\Omega \subseteq \mathbb{R}^n$ that contains a neighborhood of the origin "$0$"?

Best Answer

Here is a generalization of the result that you want:

Theorem: Let $f,g$ be two continuous functions such that $f = g$ a.e. Then $f = g$ everywhere.

Proof: Let $E$ be the set of all $x$ such that $f(x) \neq g(x)$. Suppose $E$ is not empty and so contains some $x$. Then $E$ being the complement of a closed set is open and so we can find $\epsilon > 0$ such that $B_\epsilon(x) \subseteq E$. But now this means $$0 < \mu(B_\epsilon(x)) \leq \mu(E)$$ contradicting $\mu(E) = 0$. It follows that $E$ has to be empty so that $f = g$ everywhere.