Let $X$ be a Hausdorff space suchEdit: In the first version I had the additional assumption that for each singleton in $x \in X$ there$X$ is a continuous $f \in C(X)$ with $Z(f)=\lbrace x \rbrace$ (examples are metric spaces, discrete spaces, totally disconnetected spaces)zero set. The following statement answers your question forBut as observed by AliReza Olfati the space $X$proof can be adapted to work in the general case. Therefore we have:
$Z(I)$ is finite if and only if the following holds:
- There is $A \subseteq X$ closed and $x_1,...,x_m \in X\setminus A$ with $X=A\cup \lbrace x_1,...,x_m\rbrace$.
- $Z(I) = \lbrace A \cup T \mid T \subseteq \lbrace x_1,...,x_m\rbrace\;\rbrace$. In particular $|Z(I)|=2^m$ is a power of $2$.
- $I=(1-\delta_{A \cup T} \mid T \subseteq \lbrace x_1,...,x_m\rbrace)$
Proof: $(\Rightarrow)$ Let $Z(I) = \lbrace Z(f_1),...,Z(f_n)\rbrace$.
First note that $Z(fg)=Z(f)\cup Z(g)$ and $Z(f^2 + g^2) = Z(f) \cap Z(g)$. Hence $Z(I)$ is closed under $\cup, \cap$$\cap$ and we have $$A := Z(f_1) \cap ... \cap Z(f_n) \in Z(I).$$ Let
Let $A=Z(f_{i_0})$$A=Z(f_0)$. If $A = X$ then
Next let's show that $Z(I)=\lbrace X \rbrace$ and$X \setminus A$ is finite. Suppose $I=0$$X \setminus A$ is infinite. Otherwise chooseSince $x_1 \in X \setminus A$$X$ is Hausdorff and $h \in C(X)$ with$A$ is closed, then there is a sequence of closed subsets $Z(h)=\lbrace x_1 \rbrace$$A \cup \lbrace x_1,...,x_k\rbrace$. ThenHence it's enough to show that there are only finitely many closed subsets $f:= f_{i_0}h \in I$ and$C \supseteq A$ in $Z(f)=A \cup \lbrace x_1 \rbrace \in Z(I)$$X$. Hence
$A \cup \lbrace x_1 \rbrace = Z(f_{i_1})$ for someSince $1 \le i_1 \le n$.
Continuing this way$X$ is completely regular, such a $C$ is the intersection of zero sets (Gillman-Jerison: Rings of continuous functions, Theorem 3.2). Thus we findhave a surjection $$\lbrace Z \subseteq X \mid Z \supseteq A \text{ zero set }\;\rbrace\to \lbrace C \subseteq X \mid C \supseteq A \text{ closed }\rbrace,\; \mathfrak{Z} \mapsto \bigcap_{Z \in \mathfrak{Z}}Z.$$ Let $x_1,...,x_k \in X \setminus A$ with$Z=Z(h) \supseteq A$ be a zero set. Then $X_j := A \cup \lbrace x_1,...,x_j \rbrace = Z(f_{i_j})$ for$f_0h \in I$ with $0 \le j \le k$$Z(f_0h)=Z(f_0) \cup Z(h) = Z$, i. This procedure can be continued as long ase. $X_k \varsubsetneqq X$$Z \in Z(I)$. But sinceHence the LHS of the map is just the finite set $Z(I)$ and consequently its image is also finite,. Hence the process must stop, ifiniteness of $X \setminus A$ and 1) are shown.e
Let $X \setminus A = \lbrace x_1,...,x_m\rbrace$. thereSince $A$ is closed and $m$ with$X$ is Hausdorff it follows that $X_m = X$$A$, $\lbrace x_i\rbrace$ are both, open and closed. This shows 1)Hence a function $f: X \to \mathbb R$ is continuous iff $f|A$ is continuous. In particular we find continuous $h$ with $Z(h)=\lbrace x_i\rbrace$.
To see 2) let $f \in I$. By definition $A \subseteq Z(f)$. Thus $T := Z(f) \setminus A \subseteq \lbrace x_1,...,x_m\rbrace$ and $Z(f)=A \cup T$ is in the RHS. Conversely, if $T = \lbrace x_{p_1},...,x_{p_k}\rbrace$, then then choose $h_j \in C(X)$ with $Z(h_j) = \lbrace x_{p_j}\rbrace$. Now $f := f_{i_0}h_1\cdots h_p \in I$$f := f_0h_1\cdots h_p \in I$ and $Z(f) = A \cup T \in Z(I)$.
- Note that the functions used in the following are continuous becauseby the remark preceding the proof of 2). Let $A$$f \in I$ and let $X \setminus Z(f) = \lbrace x_{p_1},...,x_{p_k}\rbrace$. Then $f= \sum_j f(x_{p_j})(1-\delta_{X \setminus \lbrace x_{p_j} \rbrace})$ is contained in the RHS. Conversely, let $\lbrace x_i \rbrace$ are both$T \subseteq \lbrace x_1,...,x_m\rbrace$ be given. By 2) there is $f \in I$ with $Z(f) = A \cup T$. Define a continuous map $h$ by $h|Z(f) = 0$, open and closed$h(x) = 1/f(x)$ if $x \notin Z(f)$. Then $1-\delta_{A \cup T} = fh \in I$.
Let $f \in I$ and let $X \setminus Z(f) = \lbrace x_{p_1},...,x_{p_k}\rbrace$. Then $f= \sum_j f(x_{p_j})(1-\delta_{X \setminus \lbrace x_{p_j} \rbrace})$ is contained in the RHS. Conversely, let $T \subseteq \lbrace x_1,...,x_m\rbrace$ be given. By 2) there is $f \in I$ with $Z(f) = A \cup T$. Define a continuous map $h$ by $h|Z(f) = 0$, $h(x) = 1/f(x)$ if $x \notin Z(f)$. Then $1-\delta_{A \cup T} = fh \in I$.
$(\Leftarrow)$ If $X$ is given by 1) and $I$ by 3) then $Z(I) = \lbrace A \cup T \mid T \subseteq \lbrace x_1,...,x_m\rbrace\;\rbrace$ follows easily. q.e.d.