TITLE: Ideal in $C(X)$
QUESTION [12 upvotes]: Let $X$ be a compact Hausdorff space, and $C(X)$ the space of complex-valued continuous functions with maximum-norm.
The following problem is driving me little nuts. I want to show that every closed Ideal $J\subset C(X)$ is of the form $J_Y = \{f\in C(X)| Y\subset f^{-1}(0)\}$ where $Y\subset X$ is some closed set. It seems that $Y=\bigcap_{f\in J}f^{-1}(0)$ is the only logical choice. Then $J\subset J_Y$ is obvious, but $J_Y\subset J$ is not so obvious. 
It seemed logical to me that if $f\in J$ then $J_{f^{-1}(0)} \subset J$, but I can't prove it. If this would be true I thought of finding a $g\in J$ such that $g^{-1}(0)=Y $ would then be sufficient. Maybe constructing a sequence of functions $g_n\in J_n\subset J$ that is 0 on some $Y_n\supset Y$ and using the fact that $J$ is closed to show $g_n\to g\in J$.
Does someone have any suggestions? I'm little stuck.

REPLY [2 votes]: A very clean way to prove this is by invoking the Stone-Weierstrass theorem.  First note that $J$ is closed under conjugation: if $f\in J$ and $\epsilon>0$ we can take a function $g\in C(X)$ of norm $1$ which agrees with $\bar{f}/f$ everywhere that $|f|\geq\epsilon$.  Then $\|gf-\bar{f}\|\leq 2\epsilon$ and $gf\in J$, and taking $\epsilon\to 0$ we conclude that $\bar{f}\in J$.
Now let $A=\mathbb{C}+J$, the set of functions which can be written as a constant plus an element of $J$.  Every element of $A$ is constant on the set $Y$, and so we can naturally consider $A$ as a subalgebra of $C(X/Y)$, where $X/Y$ is the quotient space obtained by identifying all elements of $Y$ to a point.  Moreover, $A$ separates points of $X/Y$.  Indeed, if $x\in X\setminus Y$ we can find $f\in J$ such that $f(x)\neq 0$, separating $x$ from $Y$, and if $x,y\in X\setminus Y$ are distinct then we can find $f\in J$ not vanishing on $x$ and then multiply by $g\in C(X)$ which vanishes at $y$ but not $x$ to get $fg\in J$ separating $x$ and $y$.  Since $J$ is closed under conjugation, $A$ is thus a closed unital *-subalgebra of $C(X/Y)$ which separates points and so is all of $C(X/Y)$ by Stone-Weierstrass.
In other words, every function on $X$ which is constant on $Y$ can be written as a constant plus an element of $J$.  In particular, every function which vanishes on $Y$ must be in $J$.