TITLE: Subalgebra of $C(X)$ where $X$ is a compact Hausdorff space
QUESTION [5 upvotes]: Proposition Let $X$ be a compact Hausdorff space and $C(X)$ be the set of all continuous real-valued functions on $X$. Let $\mathcal{A}$ be a subalgebra of $C(X)$ that separates points of $X$. Show that either $\overline{\mathcal{A}}= C(X)$ or there is a point $x_{0}$ such that $\overline{\mathcal{A}}= \{\ f\in C(X): f(x_{0})=0 \}\ $.

My attempt: 

If constant function $1$ belongs to $\mathcal{A}$, then subalgebra $\mathcal{A}$ contains all constant functions and $\mathcal{A}$ is dense in $C(X)$ by Stone-Weierstrass theorem. 
Otherwise, $1\notin \mathcal{A}$. Suppose that for each $x\in X$ there is an $f\in \mathcal{A}$ with $f(x)\neq 0$, then by the continuity of each $f$ and compactness of $X$ I can prove that there is a $g\in \mathcal{A}$ that is positive on $X$. But how can I use this fact to conclude a contradiction i.e. $1\in \mathcal{A}$ so that we prove the exsitence of such $x_{0}$? And I was also wondering how to prove $\{\ f\in C(X): f(x_{0})=0 \}\ \subset \overline{\mathcal{A}}$?

Thanks!

REPLY [2 votes]: Assume that $\mathcal{A}$ is itself closed, and suppose $1\notin \mathcal{A}$, then note that
$$
\mathcal{A}\oplus \mathbb{R}1 = C(X)
$$
by the Stone-Weierstrass theorem. Hence you can define a linear functional $\varphi : C(X)\to \mathbb{R}$ by
$$
\varphi(f+ \lambda) = \lambda
$$
This is a well-defined bounded linear functional which is also multiplicative. Hence, $\exists x_0 \in X$ such that
$$
\varphi(g) = g(x_0)
$$
Since $\ker(\varphi) = \mathcal{A}$ it follows that
$$
\mathcal{A} = \{f\in C(X) : f(x_0) = 0\}
$$