I'm solving a problem from Atiyah-Macdonald.
I have to show that if $X=\operatorname{Spec} A$ is not connected then $A$ contains idempotents $e \neq 0,1$.
The converse is easy. If $e \in A$ is an idempotent then $(e)+(1-e)=(1)$ and $(e)\cdot(1-e)=0$ so that $$ V(e) \cup V(1-e) = V( (e) \cdot(1-e))=V(0) = X, \\ V(e) \cap V(1-e) = V( (e)+(1-e))=V(1)=\varnothing $$ then $V(e)$ and $V(1-e)$ are both closed and open and $X$ is not connected.
Now let $\mathfrak{a}$ and $\mathfrak{b}$ be ideals in $A$ such that $V(\mathfrak{a}) \cup V(\mathfrak{b})=X$, $V(\mathfrak{a}) \cap V(\mathfrak{b}) = \varnothing$. Then $$ V(\mathfrak{a}) \cup V(\mathfrak{b}) = V( \mathfrak{a} \cap \mathfrak{b} ) = X, $$ i.e. $\left\{ \mathfrak{p} - \text{prime} \mid \mathfrak{a} \cap \mathfrak{b} \subseteq \mathfrak{p} \right\} = X$, i.e. $\mathfrak{a} \cap \mathfrak{b} \subseteq \cap \mathfrak{p} = \mathfrak{n}$ (nilradical). On the other hand since $$ V(\mathfrak{a}) \cap V(\mathfrak{b}) = V(\mathfrak{a}+\mathfrak{b})=\varnothing $$ we have $\left\{ \mathfrak{p} - \text{prime} \mid \mathfrak{a}+\mathfrak{b} \subseteq \mathfrak{p} \right\} = \varnothing$. Then $\mathfrak{a}+\mathfrak{b}=(1)$ because any ideal that is not equal to $(1)$ is contained in some maximal ideal. Then $\mathfrak{a}$ and $\mathfrak{b}$ are comprime and $\mathfrak{a} \cdot \mathfrak{b} = \mathfrak{a} \cap \mathfrak{b}$. So I have two ideals $\mathfrak{a}$ and $\mathfrak{b}$ with properties $$ \mathfrak{a} + \mathfrak{b} = (1), \\ \mathfrak{a} \cdot \mathfrak{b} = \mathfrak{a} \cap \mathfrak{b} = \mathfrak{n}. $$ I don't see any way to obtain a nontrivial idempotent $e \in A$ here. Please help me.