[proofplan]
We approximate $f$ by continuous step functions that are constant on small pieces of the domain. For each resolution $i \ge 1$, we partition $\mathbb{R}^{m}$ into Borel sets of diameter less than $1/i$ and pull back to obtain a partition of $A$. Inner regularity lets us replace each measurable fiber with a compact subset, losing at most $\varepsilon/2^{i+j}$ in measure. Taking finitely many of these compact pieces produces a compact set $D_i$ on which a step function $g_i$ approximates $f$ to within $1/i$. The intersection $K = \bigcap_i D_i$ is compact, satisfies $\mu(A \setminus K) < \varepsilon$, and carries the uniform limit of the $g_i$, which forces $f|_K$ to be continuous.
[/proofplan]
[claim:Inner regularity for finite-measure sets]
Let $\nu$ be a Radon measure on $\mathbb{R}^{n}$ and let $E \subseteq \mathbb{R}^{n}$ be $\nu$-measurable with $\nu(E) < \infty$. For every $\delta > 0$ there exists a [compact set](/page/Compact%20Space) $K \subseteq E$ such that $\nu(E \setminus K) < \delta$.
[/claim]
[proof]
Since $\nu$ is a Radon measure, it is [outer regular](/page/Outer%20Regularity) on all $\nu$-measurable sets: there exists an [open set](/page/Open%20Set) $U \supseteq E$ with $\nu(U) < \nu(E) + \delta/2$, so $\nu(U \setminus E) < \delta/2$. Because $\nu$ is [inner regular](/page/Inner%20Regularity) on open sets of finite measure (a defining property of Radon measures), there exists a compact set $C \subseteq U$ with $\nu(U \setminus C) < \delta/2$.
We now extract a compact subset of $E$ from $C$. The set $C \setminus E$ satisfies $C \setminus E \subseteq U \setminus E$, so $\nu(C \setminus E) \le \nu(U \setminus E) < \delta/2$. Apply [outer regularity](/page/Outer%20Regularity) to $C \setminus E$: there exists an open set $V \supseteq C \setminus E$ with $\nu(V) < \delta/2$. Define $K := C \setminus V$. Since $C$ is compact and $V$ is open, $K = C \cap V^c$ is the intersection of a compact set with a closed set, hence compact. Moreover $K \subseteq E$: every point of $K$ lies in $C$ but not in $V$, and since $C \setminus E \subseteq V$, any point of $C$ outside $V$ must belong to $E$. We estimate:
\begin{align*}
\nu(E \setminus K)
&\le \nu(E \setminus C) + \nu(C \setminus K) \\
&= \nu(E \setminus C) + \nu(C \cap V) \\
&\le \nu(U \setminus C) + \nu(V) \\
&< \frac{\delta}{2} + \frac{\delta}{2} = \delta.
\end{align*}
[/proof]
[step:Partition the range into Borel sets of diameter less than $1/i$]
For each integer $i \ge 1$, partition $\mathbb{R}^{m}$ into countably many pairwise disjoint Borel sets $\{B_{ij}\}_{j=1}^{\infty}$ satisfying
\begin{align*}
\bigcup_{j=1}^{\infty} B_{ij} = \mathbb{R}^{m}, \qquad \operatorname{diam} B_{ij} < \frac{1}{i} \quad \text{for every } j \ge 1.
\end{align*}
Such a partition exists: tile $\mathbb{R}^{m}$ by half-open cubes of side length $1/(2i\sqrt{m})$. Each cube has diameter equal to $\sqrt{m} \cdot \frac{1}{2i\sqrt{m}} = \frac{1}{2i} < \frac{1}{i}$. Define the preimage fibers
\begin{align*}
A_{ij} := A \cap f^{-1}(B_{ij}).
\end{align*}
Since $f$ is $\mu$-[measurable](/page/Measurable%20Functions) and each $B_{ij}$ is Borel, every $A_{ij}$ is $\mu$-measurable. The fibers partition $A$: $\bigcup_{j=1}^{\infty} A_{ij} = A$ and $A_{ij} \cap A_{ik} = \varnothing$ for $j \neq k$.
[/step]
[step:Extract compact cores from each fiber via inner regularity]
Define the restricted measure $\nu := \mu \llcorner A$ (i.e., $\nu(E) = \mu(E \cap A)$ for every $\mu$-measurable set $E$). Since $\mu$ is Radon and $\mu(A) < \infty$, the restriction $\nu$ is again a Radon measure on $\mathbb{R}^{n}$.
Apply the [claim above (Inner regularity for finite-measure sets)] to each fiber $A_{ij}$ with tolerance $\delta = \varepsilon / 2^{i+j}$. This yields a compact set $K_{ij} \subseteq A_{ij}$ satisfying
\begin{align*}
\nu(A_{ij} \setminus K_{ij}) < \frac{\varepsilon}{2^{i+j}}.
\end{align*}
Summing the measure losses over all fibers at resolution $i$:
\begin{align*}
\mu\!\Bigl(A \setminus \bigcup_{j=1}^{\infty} K_{ij}\Bigr)
&= \nu\!\Bigl(A \setminus \bigcup_{j=1}^{\infty} K_{ij}\Bigr) \\
&\le \sum_{j=1}^{\infty} \nu(A_{ij} \setminus K_{ij}) \\
&< \sum_{j=1}^{\infty} \frac{\varepsilon}{2^{i+j}}
= \frac{\varepsilon}{2^{i}}.
\end{align*}
The second line uses the fact that $A = \bigsqcup_j A_{ij}$ and $K_{ij} \subseteq A_{ij}$, so removing all $K_{ij}$ from $A$ amounts to removing each $K_{ij}$ from its own fiber $A_{ij}$.
Because $\mu(A) < \infty$ and the sets $\bigcup_{j=1}^{N} K_{ij}$ increase to $\bigcup_{j=1}^{\infty} K_{ij}$ as $N \to \infty$, continuity of measure from below gives
\begin{align*}
\lim_{N \to \infty} \mu\!\Bigl(A \setminus \bigcup_{j=1}^{N} K_{ij}\Bigr) = \mu\!\Bigl(A \setminus \bigcup_{j=1}^{\infty} K_{ij}\Bigr) < \frac{\varepsilon}{2^{i}}.
\end{align*}
Choose $N(i) \in \mathbb{N}$ large enough that
\begin{align*}
\mu\!\Bigl(A \setminus \bigcup_{j=1}^{N(i)} K_{ij}\Bigr) < \frac{\varepsilon}{2^{i}}.
\end{align*}
Set $D_i := \bigcup_{j=1}^{N(i)} K_{ij}$. As a finite union of compact sets, $D_i$ is compact.
[guided]
We need the total measure loss at each resolution level $i$ to be at most $\varepsilon / 2^i$, so that summing over all levels $i = 1, 2, \ldots$ in the final intersection step gives a geometric series totalling $\varepsilon$. Within each level $i$, there are infinitely many fibers $A_{ij}$, so we must also sum over $j$. The double-index budget $\delta = \varepsilon / 2^{i+j}$ is chosen precisely to make this work.
Define the restricted measure $\nu := \mu \llcorner A$, so $\nu(E) = \mu(E \cap A)$ for every $\mu$-measurable set $E$. Since $\mu$ is Radon and $\mu(A) < \infty$, the restriction $\nu$ is again Radon. Apply the Inner regularity claim to each fiber $A_{ij}$ with tolerance $\delta = \varepsilon / 2^{i+j}$, obtaining a compact set $K_{ij} \subseteq A_{ij}$ with $\nu(A_{ij} \setminus K_{ij}) < \varepsilon / 2^{i+j}$. The geometric series confirms our budget:
\begin{align*}
\sum_{j=1}^{\infty} \frac{\varepsilon}{2^{i+j}} = \frac{\varepsilon}{2^i} \cdot \sum_{j=1}^{\infty} \frac{1}{2^j} = \frac{\varepsilon}{2^i}.
\end{align*}
Since $A = \bigsqcup_j A_{ij}$ and $K_{ij} \subseteq A_{ij}$, the total measure loss at level $i$ is
\begin{align*}
\mu\!\Bigl(A \setminus \bigcup_{j=1}^{\infty} K_{ij}\Bigr)
= \nu\!\Bigl(A \setminus \bigcup_{j=1}^{\infty} K_{ij}\Bigr)
\le \sum_{j=1}^{\infty} \nu(A_{ij} \setminus K_{ij})
< \frac{\varepsilon}{2^{i}}.
\end{align*}
Why do we truncate to finitely many compact cores? The countable union $\bigcup_{j=1}^{\infty} K_{ij}$ need not be compact --- a countable union of compact sets is, in general, only $\sigma$-compact. We need compactness of $D_i$ to ensure that the intersection $K = \bigcap_i D_i$ is compact. The truncation to $N(i)$ terms is justified by continuity of measure: since $\mu(A) < \infty$, the sets $\bigcup_{j=1}^{N} K_{ij}$ increase as $N$ grows, so
\begin{align*}
\lim_{N \to \infty} \mu\!\Bigl(A \setminus \bigcup_{j=1}^{N} K_{ij}\Bigr) = \mu\!\Bigl(A \setminus \bigcup_{j=1}^{\infty} K_{ij}\Bigr) < \frac{\varepsilon}{2^{i}}.
\end{align*}
Choose $N(i)$ large enough that $\mu(A \setminus \bigcup_{j=1}^{N(i)} K_{ij}) < \varepsilon / 2^{i}$, and set $D_i := \bigcup_{j=1}^{N(i)} K_{ij}$. As a finite union of compact sets, $D_i$ is compact.
[/guided]
[/step]
[step:Construct continuous step functions approximating $f$ on the compact cores]
For each pair $(i, j)$ with $1 \le j \le N(i)$, fix a point $b_{ij} \in B_{ij}$ and define the step function
\begin{align*}
g_i : D_i &\to \mathbb{R}^{m}, \\
g_i(x) &:= b_{ij} \quad \text{whenever } x \in K_{ij}.
\end{align*}
This is well-defined because the compact sets $K_{i1}, K_{i2}, \ldots, K_{iN(i)}$ are pairwise disjoint (they are subsets of the pairwise disjoint fibers $A_{ij}$) and their union is $D_i$.
Each $g_i$ is [continuous](/page/Continuity) on $D_i$: the sets $K_{i1}, \ldots, K_{iN(i)}$ are compact and pairwise disjoint, so they have pairwise positive separation distances (if two compact subsets of $\mathbb{R}^n$ are disjoint, the infimum of distances between them is strictly positive). Each $K_{ij}$ is therefore both open and closed in the subspace topology of $D_i$, and $g_i$ is constant on each such clopen piece.
The step function $g_i$ approximates $f$ to within $1/i$ on $D_i$. For every $x \in K_{ij}$, both $f(x)$ and $b_{ij}$ lie in the same Borel set $B_{ij}$, which has diameter less than $1/i$. Hence
\begin{align*}
\|f(x) - g_i(x)\| = \|f(x) - b_{ij}\| < \frac{1}{i} \qquad \text{for all } x \in D_i.
\end{align*}
[/step]
[step:Intersect the cores to form the final compact set $K$ with $\mu(A \setminus K) < \varepsilon$]
Define
\begin{align*}
K := \bigcap_{i=1}^{\infty} D_i.
\end{align*}
Each $D_i$ is a compact subset of $A$, so $K$ is an intersection of compact sets and is therefore compact (and $K \subseteq A$).
We estimate the measure of the discarded portion $A \setminus K$. Since $A \setminus K = A \setminus \bigcap_i D_i = \bigcup_{i=1}^{\infty}(A \setminus D_i)$, subadditivity of $\mu$ gives
\begin{align*}
\mu(A \setminus K)
= \mu\!\Bigl(\bigcup_{i=1}^{\infty}(A \setminus D_i)\Bigr)
\le \sum_{i=1}^{\infty} \mu(A \setminus D_i)
< \sum_{i=1}^{\infty} \frac{\varepsilon}{2^{i}}
= \varepsilon.
\end{align*}
This establishes conclusion (i): $\mu(A \setminus K) < \varepsilon$.
[/step]
[step:Conclude continuity of $f|_K$ via uniform convergence of the step functions]
For every $x \in K$ and every $i \ge 1$, we have $x \in D_i$ (since $K \subseteq D_i$), so the estimate from the previous step gives
\begin{align*}
\|f(x) - g_i(x)\| < \frac{1}{i} \qquad \text{for all } x \in K.
\end{align*}
Taking the supremum over $x \in K$:
\begin{align*}
\sup_{x \in K} \|f(x) - g_i(x)\| \le \frac{1}{i} \xrightarrow{i \to \infty} 0.
\end{align*}
Hence the [sequence](/page/Sequence) of continuous functions $g_i|_K : K \to \mathbb{R}^{m}$ converges [uniformly](/page/Uniform%20Convergence) to $f|_K$ on $K$.
Since each $g_i|_K$ is continuous (as the restriction of a continuous function to a subset) and [uniform convergence](/page/Uniform%20Convergence) preserves continuity --- the [uniform limit](/page/Uniform%20Convergence) of continuous functions on a [metric space](/page/Metric%20Space) is continuous --- the limit function $f|_K$ is continuous. This establishes conclusion (ii).
[guided]
For every $x \in K$ and every $i \ge 1$, the inclusion $K \subseteq D_i$ ensures $x \in D_i$, so the approximation bound from the step-function construction gives
\begin{align*}
\|f(x) - g_i(x)\| < \frac{1}{i} \qquad \text{for all } x \in K.
\end{align*}
The bound $1/i$ is independent of $x$ --- it depends only on the diameter constraint $\operatorname{diam} B_{ij} < 1/i$, which holds uniformly over all $j$. This is the critical point: taking the supremum over $x \in K$ yields
\begin{align*}
\sup_{x \in K} \|f(x) - g_i(x)\| \le \frac{1}{i} \xrightarrow{i \to \infty} 0,
\end{align*}
so $g_i|_K \to f|_K$ uniformly on $K$.
Why does uniform convergence matter here, rather than pointwise convergence? Pointwise convergence of continuous functions does not preserve continuity in general: the [sequence](/page/Sequence) $h_i : [0,1] \to \mathbb{R}$ defined by $h_i(x) = x^i$ converges pointwise to the discontinuous function $\mathbb{1}_{\{1\}}$. The upgrade from pointwise ($\|f(x) - g_i(x)\| < 1/i$ for each fixed $x$) to uniform ($\sup_{x \in K} \|f(x) - g_i(x)\| \le 1/i$) is what makes the classical theorem on [uniform limits](/page/Uniform%20Convergence) of continuous functions applicable.
Each $g_i|_K$ is continuous on $K$ because $g_i$ is continuous on $D_i \supseteq K$ and the restriction of a continuous function to a subset is continuous. Since the [uniform limit](/page/Uniform%20Convergence) of continuous functions on a [metric space](/page/Metric%20Space) is continuous, the limit function $f|_K$ is continuous. This establishes conclusion (ii).
[/guided]
[/step]