How to show a quasi-compact, Hausdorff space be totally disconnected? This is from Atiyah-Macdonald. I was asked to show if every prime ideal of $A$ is maximal, then $A/R$ is absolutely flat, Spec($A$) is a $T_{1}$ space,further Spec($A$) is Hausdorff. The author then asked me to show Spec($A$) is totally disconnected. I am wondering why, because it is not automatic that a compact Hausdorff space is totally disconnected (consider $\mathbb{S}^{1}$ as one-point compactification of $\mathbb{R}$, for example). Why can we put Spec$A$ a discrete topology when we know elements $\{p\}$ is closed? 
 A: Okay, so first, there is a distinction made between quasicompactness and compactness. A topological space $X$ is quasicompact if every open cover of $X$ has a finite subcover. The topological space $X$ is said to be compact if it is quasicompact and Hausdorff.
We know the $Spec(A)$ is quasicompact for any ring $A$. If you have managed to show for the above problem that $Spec(A)$ is Hausdorff, then this means that $Spec(A)$ is compact.
Claim: For a non-unit $f$, the distinguished open set $D(f) = \{p \in Spec(A): f \notin p \}$ is closed.
Proof of claim: Since $f$ is not a unit, it follows that $D(f) \subsetneq Spec(A)$. Our goal will be to show that $Spec(A) - D(f)$ is open. Let $p \in Spec(A) - D(f)$. Then, $f \in p$. Note that $f$ is nilpotent in $A_p$, since the only prime of $A_p$ is $p(A_p)$. Thus, there exists $s_p \in A - p$ such that $s_pf^n = 0$ for some $n \in \mathbb{N}$. Then $p \in D(s_p)$, and $D(s_p) \cap D(f) = \emptyset$. Thus, $D(s) \subset Spec(A) - D(f)$. Since $p$ was an arbitrary point of $Spec(A) - D(f)$, this shows that $Spec(A) - D(f) = \bigcup_{p \in Spec(A) - D(f)} D(s_p)$ is open, hence $D(f)$ is closed.
Thus, for all $f \in A$, $D(f)$ is a clopen set (simultaneously closed and open).
Now let $C$ be a connected component of $Spec(A)$ with more than one element, say $p_1, p_2$. Since $p_1, p_2$ are maximal and distinct, there exists $f \in p_1$ such that $f \notin p_2$. Then $D(f)$ is a clopen set that contains $p_2$ but not $p_1$. This shows that $C \cap D(f)$ is a proper clopen set of $C$, which contradicts the connectedness of $C$.
