Let be a compact metric space which has at least two points, and let be the space of continuous functions with the uniform norm . Let be a dense subset of and for each define by
Let be the subalgebra of generated by the collection (with pointwise addition and multiplication of functions).
In light of Stone-Weierstrass, it suffices to show that vanishes nowhere and separates points.
Let . Then by assumption, there exists different from , so let . By density of , there exists such that . Then by the triangle inequality,
so in particular, . To show that separates points, let be distinct. As before, let . By density, there exists such that , so by the same calculation as before. Thus,
so separates and , so is dense in .
Since is a compact metric space, it is separable. Thus, let be a countable dense subset of so that (as in the previous part) is dense in . Notice that elements in have the form
where , , and . Hence, it is easy to see that if we replaced with elements in , then the resulting set of functions is dense in , hence dense in . Since is countable and is countable, it follows that is also countable, so is separable.