[proofplan]
We argue by contradiction. If $f \ne 0$ on a set of positive measure, then (after possibly replacing $f$ by $-f$) the set $S^+ := \{f > 0\}$ has positive Lebesgue measure. By the [Lebesgue Differentiation Theorem](/theorems/74), we find a ball $B \subset \Omega$ on which $\int_B f \, d\mathcal{L}^n > 0$. Mollifying the characteristic function of a slightly smaller ball produces test functions $\phi_\varepsilon \in C_c^\infty(\Omega)$ with $\phi_\varepsilon \to \mathbf{1}_{B'}$ a.e. The hypothesis forces $\int_\Omega f\, \phi_\varepsilon \, d\mathcal{L}^n = 0$ for each $\varepsilon$, but the [Dominated Convergence Theorem](/theorems/4) gives $\int_{B'} f \, d\mathcal{L}^n > 0$ in the limit --- a contradiction.
[/proofplan]
[step:Assume for contradiction that $f \ne 0$ on a set of positive measure]
Suppose the conclusion fails: the set $\{x \in \Omega : f(x) \ne 0\}$ has positive Lebesgue measure. Decompose it as
\begin{align*}
S^+ := \{x \in \Omega : f(x) > 0\}, \qquad S^- := \{x \in \Omega : f(x) < 0\}.
\end{align*}
At least one of $\mathcal{L}^n(S^+)$ and $\mathcal{L}^n(S^-)$ is positive. WLOG assume $\mathcal{L}^n(S^+) > 0$; if instead $\mathcal{L}^n(S^-) > 0$, the same argument applies to $-f$ (which also satisfies the hypothesis by linearity).
[/step]
[step:Locate a ball $B$ with strictly positive integral via the Lebesgue Differentiation Theorem]
By the [Lebesgue Differentiation Theorem](/theorems/74), for $\mathcal{L}^n$-almost every $x_0 \in \Omega$,
\begin{align*}
\lim_{r \to 0} \frac{1}{\mathcal{L}^n(B(x_0, r))} \int_{B(x_0, r)} f(y) \, d\mathcal{L}^n(y) = f(x_0).
\end{align*}
Since $\mathcal{L}^n(S^+) > 0$, there exists a Lebesgue point $x_0 \in S^+$, so $f(x_0) > 0$. Choose $r_0 > 0$ small enough that $B := B(x_0, r_0)$ satisfies $\overline{B} \subset \Omega$ and
\begin{align*}
\frac{1}{\mathcal{L}^n(B)} \int_B f(y) \, d\mathcal{L}^n(y) > \frac{f(x_0)}{2} > 0.
\end{align*}
Multiplying by $\mathcal{L}^n(B) > 0$ gives
\begin{align*}
\int_B f(y) \, d\mathcal{L}^n(y) > 0.
\end{align*}
[guided]
By the [Lebesgue Differentiation Theorem](/theorems/74), for $\mathcal{L}^n$-almost every $x_0 \in \Omega$ the averages over shrinking balls recover the pointwise value:
\begin{align*}
\lim_{r \to 0} \frac{1}{\mathcal{L}^n(B(x_0, r))} \int_{B(x_0, r)} f(y) \, d\mathcal{L}^n(y) = f(x_0).
\end{align*}
Since $\mathcal{L}^n(S^+) > 0$, the set $S^+$ contains at least one Lebesgue point $x_0$ with $f(x_0) > 0$. Because $\Omega$ is open and $x_0 \in \Omega$, we may choose $r_0 > 0$ small enough that $\overline{B(x_0, r_0)} \subset \Omega$ and the average is still close to $f(x_0)$:
\begin{align*}
\frac{1}{\mathcal{L}^n(B)} \int_B f(y) \, d\mathcal{L}^n(y) > \frac{f(x_0)}{2} > 0,
\end{align*}
where $B := B(x_0, r_0)$. Multiplying both sides by $\mathcal{L}^n(B) > 0$ gives
\begin{align*}
\int_B f(y) \, d\mathcal{L}^n(y) > 0.
\end{align*}
This strict positivity of $\int_B f \, d\mathcal{L}^n$ is the key fact that will produce a contradiction once we approximate the indicator $\mathbf{1}_B$ by smooth [test functions](/page/Test%20Function).
[/guided]
[/step]
[step:Construct smooth test functions $\phi_\varepsilon$ approximating $\mathbf{1}_{B'}$ via mollification]
Fix $\delta \in (0, r_0)$ small enough that $\int_{B'} f \, d\mathcal{L}^n > 0$, where $B' := B(x_0, r_0 - \delta)$. (This is possible because $\int_{B(x_0, r)} f \, d\mathcal{L}^n$ is continuous in $r$ by dominated convergence, and it is positive at $r = r_0$.) Let $\eta_\varepsilon$ denote the [standard mollifier](/page/Standard%20Mollifier). Define
\begin{align*}
\phi_\varepsilon := \eta_\varepsilon * \mathbf{1}_{B'}: \mathbb{R}^n &\to [0, 1] \\
x &\mapsto \int_{B'} \eta_\varepsilon(x - y) \, d\mathcal{L}^n(y).
\end{align*}
For $\varepsilon < \delta$, the function $\phi_\varepsilon$ satisfies:
- $\phi_\varepsilon \in C_c^\infty(\Omega)$, because $\operatorname{supp} \phi_\varepsilon \subset B(x_0, r_0 - \delta + \varepsilon) \subset B \subset \Omega$;
- $0 \le \phi_\varepsilon \le 1$ (since $\eta_\varepsilon \ge 0$ and $\int \eta_\varepsilon \, d\mathcal{L}^n = 1$);
- $\phi_\varepsilon(x) \to \mathbf{1}_{B'}(x)$ for $\mathcal{L}^n$-a.e. $x \in \Omega$ as $\varepsilon \to 0$.
[/step]
[step:Derive a contradiction via the hypothesis and the Dominated Convergence Theorem]
**From the hypothesis.** Each $\phi_\varepsilon$ is a valid [test function](/page/Test%20Function) in $C_c^\infty(\Omega)$ for $\varepsilon < \delta$, so the hypothesis gives
\begin{align*}
\int_\Omega f(x)\, \phi_\varepsilon(x) \, d\mathcal{L}^n(x) = 0 \qquad \text{for all } \varepsilon \in (0, \delta).
\end{align*}
**From the Dominated Convergence Theorem.** The sequence $f \cdot \phi_\varepsilon$ converges to $f \cdot \mathbf{1}_{B'}$ pointwise $\mathcal{L}^n$-a.e. as $\varepsilon \to 0$. Since $0 \le \phi_\varepsilon \le 1$, the dominating function is $|f|$, which is integrable over $\overline{B}$ (because $f \in L^1_{\mathrm{loc}}(\Omega)$ and $\overline{B}$ is compact with $\overline{B} \subset \Omega$). By the [Dominated Convergence Theorem](/theorems/4):
\begin{align*}
\lim_{\varepsilon \to 0} \int_\Omega f(x)\, \phi_\varepsilon(x) \, d\mathcal{L}^n(x) = \int_\Omega f(x)\, \mathbf{1}_{B'}(x) \, d\mathcal{L}^n(x) = \int_{B'} f(x) \, d\mathcal{L}^n(x) > 0.
\end{align*}
Combining: the limit equals both $0$ (from the hypothesis) and a strictly positive number (from DCT). This is a contradiction.
[guided]
We evaluate $\lim_{\varepsilon \to 0} \int_\Omega f\, \phi_\varepsilon \, d\mathcal{L}^n$ in two independent ways. On the one hand, each integral equals $0$ by hypothesis, so the limit is $0$. On the other hand, $f \cdot \phi_\varepsilon \to f \cdot \mathbf{1}_{B'}$ pointwise a.e., and the bound $|f \cdot \phi_\varepsilon| \le |f| \cdot 1$ provides an integrable dominator on the compact set $\overline{B}$ (since $f \in L^1_{\mathrm{loc}}(\Omega)$). The [Dominated Convergence Theorem](/theorems/4) requires three conditions: pointwise a.e. convergence (verified), an integrable dominator (verified via $|f| \in L^1(\overline{B})$), and measurability of the limit (verified since $f \cdot \mathbf{1}_{B'}$ is measurable). Applying DCT:
\begin{align*}
\lim_{\varepsilon \to 0} \int_\Omega f(x)\, \phi_\varepsilon(x) \, d\mathcal{L}^n(x) = \int_{B'} f(x) \, d\mathcal{L}^n(x) > 0.
\end{align*}
But the same limit equals $0$, giving the contradiction $0 > 0$.
[/guided]
[/step]
[step:Conclude that $f = 0$ almost everywhere in $\Omega$]
The contradiction shows that the assumption $\mathcal{L}^n(\{f \ne 0\}) > 0$ is false. Therefore $f(x) = 0$ for $\mathcal{L}^n$-almost every $x \in \Omega$.
[/step]