Questions about Proof of Lusin's Theorem I am reviewing my analysis notes, and having trouble understanding certain parts of the proof to Lusin's theorem.
$\textbf{Lusin's Theorem}$:
Let $F: [0,1] \rightarrow [0,\infty)$ be a nonnegative, measurable function.  Suppose $\epsilon > 0$.  Then $\exists$ a compact set $K \subseteq [0,1]$ such that $m(K) > 1 - \epsilon$ ($K$ fills out most of $[0,1]$), and a continuous function $g$ on $[0,1]$ such that $g(x) = f(x)$ if $x \in K$.
Here is the proof given in class:
First, find a sequence of simple functions $s_{n}$, such that $\lim \limits_{n \rightarrow \infty} s_{n}(x) = F(x)$ for all $x \in [0,1]$.  Choose $E_{n}$ measurable such that $m(E_{n}) \leq \epsilon*2^{-n-2}$, and continuous functions $f_{n}$ such that $f_{n}(x) = s_{n}(x)$ for $x \in [0,1] \setminus E_{n}$.


*

*First question: I know we can find a continuous function that is nearly equal to the characteristic function of a measurable set, and each simple function $s_{n}(x)$ is the sum of characteristic functions, but why does that mean I can find a continuous function nearly equal to the sum of simple functions?  Is it because the sum of the continuous functions for each characteristic function is itself continuous?
Now we let $Y = \bigcup \limits_{n = 1}^{\infty} E_{n}$.  Then $m(Y) \leq \frac{\epsilon}{4}$, and $f_{n}(x) = s_{n}(x)$ if $x \in [0,1] \setminus Y$.  This means $\lim \limits_{n \rightarrow \infty} f_{n}(x) = \lim \limits_{n \rightarrow \infty} s_{n}(x) = F(x)$ if $x \in [0,1] \setminus Y$. Using Egoroff's theorem, we can find a set $Z \subseteq [0,1] \setminus Y$ such that $s_{n} \rightarrow F$ uniformly on $Z$, and consequently, $f_{n} \rightarrow F$ uniformly on $Z$.  


*

*Second question: Uniform convergence of a sequence of continuous functions has a continuous limit, so doesn't this mean $F$ is continuous on $Z$?  My professor does something strange by saying $\exists$ a continuous function $G : Z \rightarrow [0, \infty)$ such that $G(x) = F(x)$ for all $x \in Z$, which has confused me.  Where did $G$ come from, and why does its codomain not include $\infty$?  What if $F$ did equal $\infty$ on some part of $Z$?
Finally, we find a compact set $K \subseteq Z$ such that $m(K) > 1 - \epsilon$, and extend $G\mid_{k}$ to a continuous function on $[0,1]$ by letting the extension be linear on the complementary intervals in $[0,1] \setminus K$.


*

*Third question: What complementary intervals of $[0,1] \setminus K$?
 A: For the first question, they are excising a small measure set $E_n$ so that, if $s_n = \sum_{k=1}^n a_k \chi_{A_k}$, for every $k,j, k \neq j$, $A_k \setminus E_n$ and $A_j \setminus E_n$ are disconnected from each other. Consequently a function which is continuous on each $A_k \setminus E_n$ is continuous on the union, and $s_n$ is certainly continuous on each of these, because it is constant on them. (Note that this continuity is in the subspace topology, which is one of the most subtle aspects of Lusin's theorem.)
For the second question, $F$ is continuous on $Z$, but this continuity is in the subspace topology. For a concrete example, consider $F(x) = \text{sign}(x)$ on $[-1,1]$. This function is not continuous. But it is continuous on $[-1,-\delta] \cup [\delta,1]$ for any $\delta > 0$. Again, this continuity is relative to the subspace topology.
A: I'm answering my own question in the event that someone finds this page and has similar questions to my own.  In addition to the other posts here (especially Ian's incredibly helpful and important note about continuity with respect to the subspace topology, which, as he said, is very subtle and yet very important for understanding what is going on), I hope this detailed post will help any visitors (it will certainly help me as I return to reference this page).
For the first question:  Since $s_{n}(x)$ is simple, we can write it canonically as $s_{n}(x) = \sum \limits_{i = 1}^{m} \alpha_{i}*\chi_{A_{i}}(x)$, where $\chi_{A_{i}}(x)$ is the characteristic function of the measurable set $A_{i}$ and the $A_{i}$'s are pairwise disjoint (i.e., if $i \neq j$, then $A_{i} \cap A_{j} = \emptyset$).
Now, for each $\chi_{A_{i}}$, find a continuous function $f$ nearly equal to it (i.e., if $\epsilon > 0$, $\exists$ a measurable set $E_{i} \subseteq [0,1]$ with $m(E_{i}) < \frac{\epsilon}{m}$ and a continuous function $f_{A_{i}}$ such that $\chi_{A_{i}} = f_{A_{i}}$ if $x \not \in E_{i}$.  Then if $f_{n} = \sum \limits_{i = 1}^{m} \alpha_{i}*f_{A_{i}}$, we can conclude since $f_{n}$ is the finite sum of continuous functions, it is continuous and equal to $s_{n}$ if $x \not \in \bigcup \limits_{i = 1}^{m} E_{i}$, where $m(\bigcup \limits_{i = 1}^{m} E_{i}) \leq \sum \limits_{i = 1}^{m} m(E_{i}) < \sum \limits_{i = 1}^{m} \frac{\epsilon}{m} = \epsilon$.  So, a simple function can be approximated by a continuous function (it is nearly equal to a continuous function).
For the second question: I made a mistake when I first stated the problem which I have fixed.  I initially defined the codomain of $F$ as $[0, \infty]$, but it is really $[0, \infty)$.  Now, the convergence of the functions is uniform on $Z$, which means the continuity of the limit is with respect to the subspace topology of $Z$ (we are thinking of $Z$ as our entire space when uniform convergence is applied).  So that is why we know there exists a function $G: Z \rightarrow [0, \infty)$ such that $G(x) = F(x)$ if $x \in Z$.  It's because to say $F$ is continuous means to say it is continuous with respect to the topology of $[0,1]$ because that is its domain, and we can't imply this from the uniform convergence because the uniform convergence is in $Z$.  Therefore, we say there is a function with domain $Z$ that is continuous (domain $Z$ means we are talking about continuity of $G$ with respect to the subspace topology of $Z$), and it is equal to our function $F$.  It is the same as saying $\chi_{\mathbb{Q}}: \mathbb{R} \rightarrow \{0, 1\}$ is not continuous anywhere, but $\chi_{\mathbb{Q}}\mid_{\mathbb{Q}}: \mathbb{Q} \rightarrow \{ 0, 1 \}$ (the restriction of $\mathbb{Q}$ to the rationals) is continuous because its domain is the rationals, so openness is with respect to the rationals (and of course the preimage of any subset of $\{ 0, 1 \}$ would either be $\emptyset$ or $\mathbb{Q}$, both of which are open wrt the subspace topology of $\mathbb{Q}$, so the restriction is continuous.
For the third question: You can extend $G$ to a continuous function on $[0,1]$ by using Tietze's Extension Theorem.  But instead of extending $G$, which has domain $Z$, extend $G \mid_{K}$, the restriction of $G$ onto $K$, because $K$ is compact and therefore closed, and then you can apply the theorem to this (to satisfy the hypotheses of theorem).  Note that since $G$ is continuous on $Z$, the restriction of $G$ is continuous on $K \subseteq Z$ if we give $K$ the subspace topology.  This follows from the fact that if $O$ is open in $[0, \infty)$, then $G^{-1}(O) \cap K = G \mid_{K}^{-1} (O)$, and $G^{-1}(O)$ is open since $G$ is continuous, so the preimage of $O$ under the restriction map is open in the subspace topology of $K$, which means the restriction is continuous.
