Let $K$ be a compact space and let $B$ be the space of bounded Borel functions on $K$ equipped with the supremum norm. Show that simple functions (i.e. functions attaining only a finite number of values) are dense in $B$.
I have seen the proof showing simple functions are dense in $L_{p}$ space. Can't see how I can adapt it to this case.
Thanks
First Proof. Let $f$ be a bounded Borel function and $\varepsilon>0$. Let $s=\sup_{x\in K} \lvert f\rvert<\infty$, $M=\lfloor M\rfloor+1$ and $n\in\mathbb N$, such that $1/n<\varepsilon$.
Let $$ E_{k,n}=\left\{x\in K: \frac{k}{n}\le f(x)<\frac{k+1}{n}\right\}, \quad -nM\le k\le nM. $$ Define $$ f_n=\sum_{k=-nM}^{nM} \frac{k}{n}\chi_{E_{k,n}}, $$ where $\chi_{E_{k,n}}$ is the characteristic of $E_{k,n}$. Then the range of $f_n$ is finite and $$ \|f_n-f\|_\infty\le \frac{1}{n}<\varepsilon. $$
Second Proof. This space, the $\mathscr L^\infty(K)$ is the dual of the space $\mathcal M(K)$ of complex (or signed) Borel measures on $K$ (this is not a trivial fact). But assuming this, what you want to show becomes very simple, as it suffices to show that if $\mu\in\mathcal M(K)$, and $\int_K f\,d\mu=0$, for every Borel $f$ with finite range, then $\mu=0$. Or equivalently: if $\int_K \chi\,d\mu=0$, for every Borel characteristic, then $\mu=0$. Or equivalently: if $\mu(E)=0$, for every Borel $E$, then $\mu=0$.