This is an exercise from Banach Algebra Techniques in Operator Theory by Douglas
My attempt:
I've seen a similar argument that shows that every maximal ideal is of the form $I_x = \{ f \in C_0(X) : f(x)= 0\}$. I tried the same approach, by considering the evaluation map $\phi_x : C_0(X) \rightarrow \mathbb{C}$, where $\phi_x(f) = f(x)$ for $x \in K$.
Then it seemed like that the same argument wouldn't work, because we are dealing with closed ideals.
So I'm not sure how to proceed.
Any help will be appreciated!
Thank you!

Typically the key to proving statements of this sort is the Stone-Weierstrass theorem. Suppose $I$ is a closed ideal in $C(X)$. First I claim that $I$ is automatically a $*$-ideal. The idea is simple: if $f\in I$, then we can multiply it by the function $\overline{f}/f$ to conclude that $\overline{f}\in I$ as well. Unfortunately, this doesn't quite work since it may not be possible to extend $\overline{f}/f$ continuously to the points where $f$ vanishes. But you can take a function $h$ of norm $1$ which agrees with $\overline{f}/f$ except where $f$ is small, and then $hf$ will be close to $\overline{f}$. Since $I$ is closed, you can then take a limit of such approximations to conclude that $\overline{f}\in I$.
Now let $K$ be the set of points of $X$ where every element of $I$ vanishes; we want to show that $I$ actually contains all functions that vanish on $K$. If $K=\emptyset$, then $I$ is not contained in any maximal ideal of $C(X)$ so it must be all of $C(X)$. So we may assume $K$ is nonempty.
Now the trick is, consider the quotient space $Y$ of $X$ that identifies all the points of $K$ together. We can naturally consider $C(Y)$ as a subalgebra of $C(X)$ (the functions that are constant on $K$), and it contains $I$ since every element of $I$ is $0$ on $K$. Now Stone-Weierstrass implies that $\mathbb{C}\cdot 1+ I$ must actually be all of $C(Y)$ (exercise: use the fact that $I$ is an ideal to show that this algebra separates points of $Y$). That is, every function on $X$ that is constant on $K$ is a constant plus an element of $I$. In particular, this implies that every function that vanishes on $K$ is in $I$, since the constant would have to be $0$.
Alternatively, here is a quicker proof if you know a bit more theory of $C^*$-algebras. The quotient $C(X)/I$ is a commutative unital $C^*$-algebra, so it is $C(K)$ for some compact Hausdorff space $K$. Moreover, the quotient homomorphism $\pi:C(X)\to C(X)/I\cong C(K)$ is induced by some continuous map $i:K\to X$. It follows that $I=\ker(\pi)$ is just the set of functions that vanish on the image of $i$.