Q:

approximate a Borel set by a continuous

I wonder if it is possible to approximate a Borel set by a continuous function
i.e. 
Let $B$ a Borel set in $(X,d)$ (compact separable metric space) I wonder if there continuous functions $f_n:X\rightarrow \mathbb{R}$ such that $f_n\rightarrow\chi_B$ ? It is possible that  $f_n\rightarrow\chi_B$ uniformly ?
Note: $\chi_B$ is the characteristic function of B.
Any suggestion is welcome, thanks.

A:

See the article http://en.wikipedia.org/wiki/Baire_function#Classification_of_Baire_functions on Baire class functions.
Those functions that are a pointwise limit of a sequence of continuous functions are called of Baire class $1$.
So what you are asking is wether each characteristic function $\chi_B$ for Borel $B$ is of Baire class $1$. The article shows that this is not the case for $B = \Bbb{Q}$ (as you only consider compact spaces, take $B = \Bbb{Q} \cap [0,1]$), because then $\chi_B$ is discontinuous everywhere, whereas the set of continuity points of a Baire class $1$ function is a $G_\delta$ set with meager complement.
What is true, however, is that if you let $\mathcal{F}$ be the smallest class of functions containing the continuous functions and which is closed under pointwise convergence, then $\mathcal{F}$ contains all functions $\chi_B$ with $B$ Borel.
To see this, let
$$
\mathcal{M} := \{ B \in \mathcal{B} \mid \chi_B \in \mathcal{F} \}.
$$
It is easy to see that $U \in \mathcal{M}$ for each open $U$ (construct something using the "dist" function). Also, one can show that $\mathcal{M}$ is a $\lambda$-system. Using Dynkin's $\pi$-$\lambda$-Theorem, we conclude $\mathcal{M} \supset \sigma(\{U \mid U \text{ open}\}) = \mathcal{B}$.

