Is the set of Borel measurable transformations the closure of continuous functions under pointwise limits? If $S$ and $T$ are topological spaces, then $f:S\rightarrow T$ is called a Borel-measurable transformation if for every Borel set $B$ in $T$, $f^{-1}(B)$ is a Borel set in $S$.  My question is, is the set of Borel-measurable transformations from $S$ to $T$ equal to the smallest set containing the continuous functions from $S$ to $T$ and closed under pointwise limits of functions?
I know this is true if $S=T=\mathbb{R}$ with the standard topology, but I was wondering if it’s true in general.  It would certainly make sense if it were true in general.
 A: This fails badly when $T\neq \mathbb{R}$. For an example (lifted from Classical Descriptive Set Theory by Kechris, Section 24.B), consider the functions $\mathbb{R}\to \{0,1\}$, where the latter has the discrete topology. Since $\mathbb{R}$ is connected, the only continuous functions are constant, and the set of constant functions is closed under pointwise limits. But there are many more Borel functions: the characteristic function of every Borel set is a Borel function $\mathbb{R}\to \{0,1\}$.

The statement is true in the following two cases: 


*

*$S$ and $T$ are separable and metrizable, and $T = \mathbb{R}$.

*$S$ and $T$ are separable and metrizable, and $S$ is zero-dimensional.


No doubt there are other situations in which it holds, but these are the cases covered in Chapter 24 of Kechris's book. 
More precisely, suppose $S$ and $T$ are metrizable and $T$ is separable. Then: 


*

*Let $\Gamma$ be a set of subsets of $S$. We say that a function $f$ is $\Gamma$-measurable if $f^{-1}(U)\in \Gamma$ for every open set $U\subseteq T$. Let $\mathcal{F}(\Gamma)$ be the set of all $\Gamma$-measurable functions $S\to T$. 

*We say that a function $S\to T$ is Baire class $1$ if it is $\Sigma^0_2$-measurable. For any ordinal $1<\alpha<\omega_1$, we say that a function is Baire class $\alpha$ if it is a pointwise limit of a sequence of functions of Baire class $<\alpha$. Let $\mathcal{B}_\alpha$ be the set of functions $S\to T$ of Baire class $\alpha$. 
Then the theorem (24.3 in Kechris) is that a function $f\colon S\to T$ is Baire class $\alpha$ if and only if it is $\Sigma^0_{\alpha+1}$-measurable, i.e. $\mathcal{B}_\alpha = \mathcal{F}(\Sigma^0_{\alpha+1})$.
Now $\bigcup_{\alpha<\omega_1}B_\alpha$ is the smallest set of functions containing the containing the Baire class $1$ functions and closed under pointwise limits of sequences. And $\bigcup_{\alpha<\omega_1} \mathcal{F}(\Sigma^0_{\alpha})$ is the set of all Borel-measurable functions $S\to T$. So we conclude that the set of Borel-measurable functions is the smallest set of functions containing the Baire class $1$ functions and closed under pointwise limits of sequences.
But your question was about the smallest set of functions containing the continuous functions and closed under pointwise limits of sequences. Why didn't we define Baire class $0$ to be the continuous functions and Baire class $1$ to be the set of pointwise limits of sequences of continuous functions?
Because it's exactly here in the "base case" that things go wrong. We need  hypotheses on $S$ and $T$, like those stated at the top, to prove that a function is $\Sigma^0_2$ measurable if and only if it is a pointwise limit of a sequence of continuous functions (see 24.10 in Kechris). This is the statement that fails in the example when $T = \{0,1\}$. 
