The problem arises from Walter Rudin's Principles of Mathematical Analysis:
$\mathit{11.38}$ $\ \ $Theorem : The continuous functions form a dense subset of $\mathscr L^2$ on $[a,b]$. More explicitly, this means that for every $f \in \mathscr L^2$ on $[a,b]$ and any $\epsilon>0$, there is a function $g$, continuous on $[a,b]$, such that $$ \|f-g\| = \left\{\int_a^b |f-g|^2 dx\right\}^{1/2} < \epsilon $$ Proof $\ \ $ We shall say that $f$ is approximated in $\mathscr L^2$ by a sequence $\{g_n\}$ if $\|f-g_n\| \to 0$ as $n \to \infty$. Let $A$ be a closed subset of $[a,b]$ and $K_A$ its characteristic function. Put $$ t(x) = \inf |x-y| \quad (y \in A) $$ and $$ g_n(x) = \frac{1}{1+nt(x)} \quad (n = 1,2,3,\ldots) $$ Then $g_n(x)$ is continuous on $[a,b]$, $g_n(x) =1$ on $A$, and $g_n(x) \to 0$ on $B$, where $B = [a,b] - A$. Hence $$ \|g_n - K_A\| \leq \left\{\int_Bg_n^2dx\right\}^{1/2} \to 0 $$ by Theorem $11.32$. Thus characteristic functions of closed sets can be approximated in $\mathscr L^2$ by continuous functions. By $(39)$, the same is true for the characteristic function of any measurable set, and hence also for simple measurable functions. If $f \geq 0$ and $f \in \mathscr L^2$,let $\{s_n\}$ be a monotonically increasing sequence of simple non-negative measurable functions such that $s_n(x) \to f(x)$. Since $|f-s_n|^2 \leq |f|^2$, Theorem $11.32$ shows that $\|f-s_n\| \to 0$. The general case follows.
My Question: I followed everything except for the bold text. How exactly does the $f\geq 0$ case imply the general case where $f$ is any function in $\mathscr{L}^2$ on $[a, b]$?
My Attempt: If $f(x)\geq0$, then there exists a monotonically increasing sequence of simple nonnegative measurable functions $s_n(x)\to f(x)$ such that $\|f-s_n\|\to 0$. That means for any $\varepsilon>0$, there is a $N\in\mathbb{N}$ such that $\|f-s_n\|<\frac{\varepsilon}{2}$ for all $n\geq N$. Recall in the proof it is said that simple measurable functions can be approximated in $\mathscr{L}^2$ by continuous functions, thus we can find a continuous function $g\in\mathscr{L}^2$ such that $\|g-s_N\|<\frac{\varepsilon}{2}$. Then $\|f-g\|\leq\|f-s_N\|+\|s_N-g\|<\frac{\varepsilon}{2}+\frac{\varepsilon}{2}<\varepsilon$, as desired.
Now suppose $f\in\mathscr{L}^2$ is arbitrary. Screeching halt.
Any hint would be greatly appreciated.
Every function $f: X \to \mathbb{\bar{\mathbb{R}}}$ can be written as $f= f^+ - f^-$ where $f^+ = \max(f,0) \geq 0$ and $f^- = max(-f,0) \geq 0$. Then approximate the pieces. This is a standard trick used in measure theory. If $f$ is $\mathbb{C}$-valued then you break up Re(f) and Im(f) further.