Let $X$ be a compact hausdorff space. Define $C(X) = \{f:X\to \Bbb R, f \text{ continuous}\}$. $C(X)$ is a commutative ring and define $ev_x$ to be the maximal ideal defined as the kernel of the map: $C(X) \to \Bbb R,f \to f(x) $.
I can show that these are all the maximal ideals of $C(X)$, define $\tilde X$ to be the set of all the maximal ideals of $C(X)$ with the following closed sets for $f\in C(X)$: $$V(f) = \{\mathfrak m \in \tilde X : f\in \mathfrak m\}.$$ We can define a map $\varphi: X \to \tilde X, \varphi(x) = ev_x$. It is easy to show that it is continuous and bijective. It is also easy to show that $\tilde X$ is compact.
Question: I would like to show that $\varphi $ is a homeomorphism.
One way to do this would be to show that $\tilde X$ is hausdorff. This involves showing that given $x,y \in X$, there exist $f,g \in C(X)$ such that $x \not\in V(f), y\not\in V(g)$ and $V(f) \cap V(g) = X$.
Alternatively, one can show that $\varphi$ is a closed map. This reduces to showing that given a closed subset $V\subset X$, one can find a function $f_1,\dots,f_n \in C(X)$ such that $\bigcap_k f^{-1}(0) = V$ or equivalently, $f = \sum_k f_k^2$ vanishes precisely on $V$.
Therefore, we can reduce the second attempt to showing that there exists some $f\in C(X)$ such that $f^{-1}(0) = V$, ie, $f$ vanishes exactly on $V$.
I know that the proof involved using some version of Urysohn's lemma but I have not been able to finish it.
Note that you are giving the Zariski topology (w.r.t. continuous functions) to $X$. This will give the original topology of $X$ if it defines the same closed sets, i.e., if closed sets of $X$ are precisely intersections of zero loci. This property corresponds to $X$ being a Tychonoff space. Every locally compact Hausdorff space is Tychonoff, so we are done.
More generally, the topology of maximal ideals of an algebra $A$ is Hausdorff if and only if the quotient of $A$ by its Jacobson radical is a Gelfand ring.
In the language of spaces, it is roughly equivalent to asking the existence of "many" pairs of closed sets $E,F$ whose union is everything.
As a reality check, Tychonoff spaces are the ones for which continuous functions separate closed sets by points. So given two distinct points, you can build two functions $e,f$ using appropriately chosen $E,F$, and they will satisfy $ef=0$. Then $V(e)^c,V(f)^c$ is a pair of open sets satisfying the Hausdorff property.