If $X$ is compact metric then $B(X)$ is non-separabale I've seen the following argument:
Let $X$ be a compact metric space, then denote by $B(X)$ the set of bounded, measurable functions on $X$. $B(X)$ with the sup-norm is a $C^*$-algebra. Then, $B(X)$ is not separable.
Now, if I take $X=[0,1]$, and denote $A=span_{\mathbb{Q}}  \{\chi_{(a,b)} \forall a,b\in \mathbb{Q}\}$ then $A$ is a countable set in $B(X)$ and I had the (wrong) feeling that $A$ is dense in $B(X)$.
Because any measurable bounded function can be approximated uniformly by simple functions.I also didn't use the compactness of $X$. 
So, why am I wrong and I'll be happy to see a proof for non-separability of $B(X)$.
 Thank you in advance.

This is false as stated. For example, $X$ could be finite, in which case $B(X)$ may as well be some $\mathbb R ^n.$
Assume $X$ is infinite. Then it contains a countably infinite subset $\{x_1,x_2,\dots\}.$ Note that singletons are closed, hence Borel, hence all countable subsets of $X$ are Borel sets. Define a map $F$ from the power set $P(\mathbb N)$ into $B(X)$ by setting $F(A) = \chi_{\{x_k : k \in A\}}.$ Then each $F(A)\in B(X).$ Note that if $A_1\ne A_2,$ then $\|F(A_1) - F(A_2)\|_\infty = 1.$ Since $P(\mathbb N)$ is uncountable, we have found uncountably many elements of $B(X)$ whose distances from one another are all $1.$ It follows that $B(X)$ is nonseparable.
I don't think this problem has too much to do with compactness.
