I have been working through Theorem 2.24 from RCA by Rudin, and I have had some difficulty understanding the argument provided in the second last paragraph.
In particular, I am not sure how Rudin extends his argument from real-valued, measurable functions such that $0 \leq f < 1$ to bounded, measurable functions. I would greatly appreciate any insight anyone has on this implicit step. Additionally, is Rudin referring to functions that have been bounded on the real line or the complex plane in this statement?
Edit: I have worked out the following details (I would appreciate any feedback to let me know if my argument is valid):
Suppose $f$ is a non-negative, real-valued, bounded, measurable function on $X$, $\mu(A) < \infty$, $f(x) = 0$ if $x \notin A$, and $\epsilon > 0$. Let $\alpha = 1 + \sup(f)$, and consider $h = \alpha^{-1} f$. It follows that $0 \leq h < 1$. Using the previously obtained result, there exists $g \in C_{c}(X)$ such that $\mu(\{ x: h(x) \neq g(x) \}) < \epsilon$. It follows that $\mu(\{ x: f(x) \neq \alpha g(x) \}) < \epsilon$. Note $\alpha g \in C_{c}(X)$ since $C_{c}(X)$ is a vector space, and so the result has been shown for non-negative, real-valued, bounded, measurable functions.
Suppose $f$ is a real-valued, bounded, measurable function on $X$, $\mu(A) < \infty$, $f(x) = 0$ if $x \notin A$, and $\epsilon > 0$. The function may be decomposed into positive and negative components such that $f = f^{+} - f^{-}$ where $f^{+}$ and $f^{-}$ are both non-negative, real-valued, bounded, measurable functions. Using the previous result, there exists $g^{+} \in C_{c}(X)$ such that $\mu(\{ x: f^{+}(x) \neq g^{+}(x) \}) < \epsilon$. Similarly, $\mu(\{ x: f^{-}(x) \neq g^{-}(x) \}) < \epsilon$ with $g^{-} \in C_{c}(X)$.
Using $g = g^{+} - g^{-}$, we obtain $\{ x: f(x) \neq g(x) \} = \{ x: f^{+}(x) \neq g^{+}(x) \} \cup \{ x: f^{-}(x) \neq g^{-}(x) \}$. It follows that $\mu(\{ x: f(x) \neq g(x) \}) \leq \mu(\{ x: f^{+}(x) \neq g^{+}(x) \}) + \mu(\{ x: f^{-}(x) \neq g^{-}(x) \}) < 2\epsilon$, and so the result has been shown for real-valued, bounded, measurable functions. Note that $g \in C_{c}(X)$ since $C_{c}(X)$ is a vector space, and so it is closed under addition.
The argument proceeds in a similar fashion for complex-valued, bounded, measurable functions using $f = u + iv$ with $u,v$ real-valued, bounded, measurable functions. I would greatly appreciated any feedback whatsoever.
Perhaps I should have used $\{ x: f(x) \neq g(x) \} \subseteq \{ x: f^{+}(x) \neq g^{+}(x) \} \cup \{ x: f^{-}(x) \neq g^{-}(x) \}$ in my argument. I believe the equality holds at the moment, although I could be mistaken. The argument proceeds in an identical manner irregardless. Note that $A$ has been assumed to be compact throughout.
Rudin first showed that if $A$ is compact and $0 \leq f<1$ then for each $\epsilon>0$ there is a $g \in C_c(X)$ such that $\mu(f \neq g)<\varepsilon$. Then in the next paragraph, Rudin generalizes to the case where $f$ is an arbitrary bounded (complex) function and $A$ is still compact. Let us see how this holds. We will reduce the cases in three steps as follows:
First suppose that the result holds for bounded real measurable $f$. Then if $f=u+iv$ is a complex bounded measurable function, then so is $u$ and $v$, so given $\epsilon>0$, there is $u', v' \in C_c(X)$ such that $\mu(u \neq u')<\epsilon/2$ and $\mu (v \neq v')<\epsilon/2$. Letting $g=u'+iv'$, we have $g \in C_c(X)$ since $C_c(X)$ is a complex vector space, and it follows that $\mu(f \neq g)<\epsilon$, since $\{ f\neq g \}\subset \{u \neq u'\} \cup \{v \neq v'\}$. Thus it suffices to show the result for bounded real measurable $f$.
Now suppose that the result holds for bounded real nonnegative measurable $f$. Then if $f$ is an arbitrary (not necessarily nonnegative) bounded real measurable function, then $f+C$ is a positive real measurable function for some real constant $C$ (since $f$ is bounded) and in this case I believe that you can easily deduce the result.
Therefore, we are only left to show the result for bounded real nonnegative measurable functions, and you already did this on your own.