A converse to Stone-Weierstrass for a metric space Let $X$ be a metric space. Suppose normed algebra $C_b(X)$ of bounded continuous real functions with norm $||f||={\rm supp}_{x\in X} |f(x)|$ has the property: if a subalgebra separates points (i.e. for any $x, y \in X$ such that $x \neq y$ there is a function in the subalgebra so that $f(x) \neq f(y)$), then it is dense in $C_b(X)$. Is it true that $X$ is compact in this case?

Yes.  Indeed, suppose $X$ is not compact, so there exists an sequence $(x_n)$ in $X$ with no convergent subsequence.  Now let $A\subset C_b(X)$ be the subalgebra consisting of functions $f$ such that the sequence $(f(x_n))$ converges.  This subalgebra is easily seen to be closed.  It separates points since $(x_n)$ has no convergent subsequence: this implies that for any $x,y\in X$, the set $\{x,y\}\cup\{x_n:n\in\mathbb{N}\}$ is discrete and closed in $X$, so by the Tietze extension theorem an arbitrary bounded function on that set can be extended to an element of $C_b(X)$.  However, $A$ is not all of $C_b(X)$, again by the Tietze extension theorem.
More generally, if $X$ is a completely regular space, then $C_b(X)\cong C(\beta X)$ via the natural inclusion $X\to\beta X$ into the Stone-Cech compactification, and closed subalgebras of $C(\beta X)$ correspond to Hausdorff quotients of $\beta X$.  Such a closed subalgebra separates points of $X$ iff the corresponding quotient of $\beta X$ does not identify any points of $X$ together.  But if $X$ is not compact, you can get such a nontrivial quotient of $\beta X$ by identifying some point of $\beta X\setminus X$ with some point of $X$.  So if $X$ is completely regular and every subalgebra of $C_b(X)$ that separates points is dense, then $X$ is compact.
