# Convergence of measurable functions in a locally compact space

Set $(X,\mathcal{B})$ a measurable space. If $f:X\rightarrow[0,\infty)$ is a measurable function then exists a sequence of simple functions $\{s_n\}_{n\geq1}$ such that

$$0\leq s_1 \leq s_2\leq \ldots \leq s_n\leq\ldots\leq f$$ e

$$f(x)=\lim_{n\to\infty}s_n(x).$$

What happens if X is locally compact?

In this case, I can take for every $n\in\mathbb{N}$

$s_n(x)=\sum_{k=1}^mc_k{1}_{A_k}(x)$

where $A_k$ is compact?

This is not possible, except perhaps in cases where the topology of $X$ is somewhat degenerate. Recall that a subset $A$ of a topological space $X$ is said to be $F_\sigma$ if $A$ is a countable union of closed sets. If $X$ is an uncountable Polish space then there exist Borel subsets of $X$ which are not $F_\sigma$. I believe that this should be true in greater generality than Polish spaces, but I'm not sure what the right conditions are to guarantee the existence of such sets.
It is not hard to see that if $A \subseteq X$ is measurable, then you can find a sequence of simple functions as in your question for $f = \mathbf{1}_A$ only if $A$ is $F_\sigma$. Indeed, if we are to have $\lim_{n \to \infty} s_n(x) = \mathbf{1}_A(x)$ for all $x$ then we must eventually have $s_n(x) > 0$ for all $x \in A$. Since $0 \leq s_n \leq \mathbf{1}_A$ we always have $s_n(x) = 0$ for $x \notin A$. From this it follows that the union of the supports of $s_n$ is equal to $A$. Hence if the support of each $s_n$ is compact then $A$ is $F_\sigma$.