Zerodimensional, compact space is homeomorphic to spectrum of some ring -- elementary attempt Let $X$ be a zerodimensional (X has a base with clopen sets) and compact (quasicompact and Haussdorf) topological space and I would like to prove that $X\cong Spec(A)$ of some ring $A.$ I don't want to refer to Stone duality because I didn't had this theorem on a lecture. I try to show that $X\cong Spec(C(X,\mathbb{Z_2})),$ where latter means continuous functions with values in $\mathbb{Z_2}.$ It is related with question:
Spectrum of a ring homeomorphic to a compact, totally disconnected space
Obviously, I can show injectivity of map given in the answer of this question, continuity, also that image of open base set is open base set. I have a trouble to deal with the surjectivity (attempt which works for real-valued functions doesn't work here because of addition in $\mathbb{Z}_2.$ I'm stuck in this point and I would like ask you for a help. It is possible that ring on a right isn't correct. I underline that I don't want to use the Stone duality, I prefer an elementar way.

Try to show that a prime ideal in $R=C(X,\Bbb Z_2)$ corresponds to a unique point in $X$ using compactness. (The sets $\{f^{-1}[\{0\}]: f \in I\}$ form a zero-set filter, when $I$ is an ideal in $R$ etc.) 
Then show $\textrm{Spec}(R) \simeq X$ via this correspondence.
