Why is every Noetherian zero-dimensional scheme finite discrete?
In the book The geometry of schemes by Eisenbud and Harris, at page 27 we find the exercise asserting that
Exercise I.XXXVI.
The underlying space of a zero-dimensional scheme is discrete; if the scheme is Noetherian, it is finite.
Thoughts
I thought that a zero-dimensional scheme is one such that, in every local ring $\mathscr O_{X,p}$, the only prime ideal is its unique maximal ideal $\mathfrak m_{X,p}.$ Hence, supposing that $X=\operatorname{Spec} R$ is affine, we deduce that every prime ideal is maximal, so each ponit in $X$ is closed. But how does this imply the discreteness? It only implies the Hausdorff-ness of $X$, right?
Furthermore, I cannot perceive what the "Noetherianity" has to do with the finiteness claimed here. In the affine case, it seems to be claiming that there are only a finite number of prime ideals in a Noetherian ring, if its scheme is zero-dimensional? For example, $\mathbb Z$ is a Dedekind domain, hence its scheme is zero-dimensional, but it has infinitely many primes: does this contradict the statement?
Thanks in advance for any reference or hint, and point out any inappropriate point if any is presented.
Edit I see why my example cannot work now: it is one-dimensinoal: don't forget the pirme $(0)$. But I am still wondering why the statement is true...
a) A noetherian zero-dimensional scheme is covered by finitely many open affines which are spectra of zero-dimensional noetherian rings.
If these spectra are discrete finite, then the scheme is discrete finite too.
This answers the second part of your question.
b) Here is why the spectrum $X=\operatorname{Spec}(A)$ of a zero-dimensional ring $A$ is Hausdorff:
Consider two distinct points of $X$, i.e. two maximal ideals $\mathfrak m,\mathfrak n\subset A$.
There exist idempotent elements $m\in \mathfrak m, n\in \mathfrak n$ with $m+n=1$.
The disjoint open subsets $ D(n), D(m)$ are then separating neighbourhoods of $\mathfrak m$ and $\mathfrak n$.
The details (and more) are to be found in the Stacks Project here.
c) If moreover $A$ is noetherian, then $X=\operatorname{Spec}(A)$ is finite and thus discrete.
Inded a noetherian ring has only finitely many minimal prime ideals and all primes are minimal in a zero-dimensional ring.
d) It is false that the spectrum of a zero-dimensional ring is discrete if the ring is not assumed noetherian:
If $A=K^\mathbb N$ is the denumerable power of a field $K$ then $A$ is zero-dimensional and $\operatorname{Spec}(A)$ is homeomorphic to the Stone-Čech compactification of $\mathbb N$, a dreadful beast which is certainly not discrete since it is compact and infinite.
As a complement to Georges's excellent answer, I think it is worth noting a systematic construction of non-discrete zero-dimensional schemes.
Start with an arbitrary scheme $S$, say noetherian to simply what follows. There is a finer topology on $S$ than the initial one, called the constructible topology on $S$. The open subsets for this topology consists in constructible subsets of $S$ (i.e. finite union of locally closed subsets). Denote this topological space by $S^{\rm cons}$. It turns out that $S^{\rm cons}$ is always totally disconnected and compact, see EGA IV.1.9.15 ($S$ is noetherian hence quasi-compact and quasi-separated). Edit So $S^{\rm cons}$ is discrete if and only if $S$ is finite (set-theoretically).
To finish, and this was really surprising for me, such a "dreadful beast" is the underlying space of a scheme ! See EGA IV.1.9.16. So
$S^{\rm cons}$ is non-discrete and zero-dimensional for any noetherian scheme such that the underlying space is infinite.
If $S_1, S_2$ are two integral algebraic varieties not birational to each other, then $S_1^{\rm cons}$ is not isomorphic to $S_2^{\rm cons}$ by looking at residue fields.