Problem connecting Topology and Algebra via Analysis

Let $C(X):=$ Set of all complex/real valued continuous functions. If $X$ is compact then all the maximal ideals in the ring $C(X)$ is of the form $M_{x}=\{f\in C(X): f(x)=0\}$ for some $x\in X$.

Is it true that: If all the maximal ideals in the ring $C(X)$ is of the form $M_{x}=\{f\in C(X): f(x)=0\}$ for some $x\in X$ then $X$ is compact.

-
The first answer to this MO question seems to imply that this at right at least for completely regular spaces, as the maximal ideals for such a space correspond to points in $\beta X$. –  martini May 16 '12 at 19:33

This turns out to be true for any completely regular space $X$:

Let $X$ be completely regular having the property that every maximal ideal in $C(X)$ is of the form $M_x$. To show that $X$ is compact, let $\mathcal C$ be a family of closed sets having the finite intersection property. We need to prove that $\bigcap_{C\in \mathcal C} C$ is nonempty.

Let $I \subset C(X)$ be the set of continuous functions such that $f^{-1}(0) \supset C$ for some $C\in \mathcal C$. Then - by complete regularity** - we have

$$\bigcap_{f\in I} f^{-1}(0) = \bigcap_{C\in \mathcal C} C$$

and $I$ is an ideal in $C(X)$ as is easily checked. But then $I$ is contained in some maximal ideal $J$, which by assumption is of the form $M_x$ for some $x\in X$. So we must have $$x \in \bigcap_{f\in I} f^{-1}(0) = \bigcap_{C\in \mathcal C} C$$ and in particular $\bigcap_{C\in \mathcal C} C \ne \emptyset$.

Add.: ** If $X$ is completely regular, $C\subset X$ is closed and $x\notin C$, then there exists a continuous function $f$ with $f(x) = 1$, $f(C) \subset \{0\}$. This implies that $x\notin \bigcap_{f: f^{-1}(0) \supset C} f^{-1}(0)$ in this case. Hence $X\setminus C$ does not intersect $\bigcap_{f: f^{-1}(0) \supset C} f^{-1}(0)$ and we must have

$$C = \bigcap_{f: f^{-1}(0) \supset C} f^{-1}(0)$$

Now take the intersection over all $C \in \mathcal C$.

-
Sorry I didn't get the point "Then by complete regularity- we have $\cap_{f\in I}f^{-1}(0)=\cap_{c\in \mathcal C}C$" –  users31526 May 19 '12 at 5:03
@Kuashik: I have added some explanation regarding this part. –  Sam May 19 '12 at 14:22

No. For example, take $X$ to be $\mathbb{N} \setminus \{ 0 \}$ equipped with the relatively prime integer topology. Then every continuous real-valued function on $X$ is constant, and so your condition is trivially satisfied, but $X$ is not compact.

-