Are bounded borel functions on a compact set the pointwise limit of continuous functions? This is from a set of lecture notes on C*algebra:

So the theorem itself is not important here. I just want to confirm whether it is true that  bounded Borel functions on a compact set are the pointwise limit of continuous functions? I have looked through all the similar questions asked on ME but none of them are specifically about bounded Borel functions on a compact set. It seems like the answer is false in the case of general borel functions where we don't know whether we have boundedness or not and it also seems like the answer is false if $f$ is defined for the whole of $R$ , but what about the case if $f$ is bounded and defined on a compact set?
 A: As pointed out by user Dave L. Renfro, Baire one functions,
namely functions that can be written as the pointwise limit of a
sequence of continuous functions, cannot be too discontinuous:
the set of points where such a function is discontinuous is
necessarily a meager set (first category in Baire's terminology).
Thus, for example, the characteristic function of the rationals
is Borel-measurable, but it is not a pointwise limit of
continuous functions.
However there is a very subtle sense in which, starting with the
continuous functions, and applying the process of taking
pointwise limits, exhausts all bounded Borel-measurable
functions, as expressed by the following:
Theorem.  Let $X$ be a second-countable,  compact, Hausdorff topological
space, and let $\mathscr B(X)$ denote the space of all bounded
Borel-measurable functions on $X$.  Suppose moreover that $S$ is
a subspace of $\mathscr B(X)$ that is closed under bounded
pointwise limits, that is,
if $\{f_n\}\subseteq S$ is a uniformly bounded  sequence, which converges
pointwise to some $f$, then $f\in  S$.
If  $S$ contains all continuous
functions then $S=\mathscr B(X)$.
This means that, if one starts with the set of continuous
functions, then add to it all pointwise limits of continuous
functions, then add all pointwise limits of functions already
added, and so on in a transfinite way, one eventually reaches all
Borel-measurable functions.

Therefore I am under the impression that the proof of Lemma 35 in
your question is incorrect.  Nevertheless I believe it can be
easily
corrected, based on the above result, as follows:
Let $S$ be the subset of $\mathscr B(X)$ for which the conclusion
of the Lemma is true.  Prove that:

*

*$S$ contains all continuous functions (that is, prove that
the Lemma holds for continuous functions).


*Prove that $S$ is closed under bounded pointwise limits.
Then the above Theorem guarantees that $S=\mathscr B(X)$, which
in turn means that the conclusion of the Lemma holds for all
bounded Borel functions!
Incidentally I can think of a couple of results which one would
be tempted to prove by asserting (incorrectly) that Borel
functions are limits of continuous functions, and which can be
proved using this strategy!
