When do we say spec(R) is disconnected? On Nathan Jacobson-Basic Algebra II if it contains an open and closed subset different from empty set and X it says; on other hand when we want to show Spec(R) is connected the only idempotent elements are 0 and 1. We start by letting Spec R is connected with non triveal idempotents how can we proof ? 
 A: First, show that a ring of the form $R = R_1 \times R_2$ has a disconnected spectrum by proving that any prime in $R$ is of the form $R_1 \times \mathfrak{p}$ for $\mathfrak{p} \in \operatorname{Spec}(R_2)$ or $\mathfrak{q}\times R_2$ for $\mathfrak{q} \in \operatorname{Spec}(R_1)$, and hence $\{\operatorname{Spec}(R_1) \times R_2\}\sqcup \{R_1\times \operatorname{Spec}(R_2)\}$ forms a disconnection of $\operatorname{Spec}(R)$.
Then show that given a nontrivial idempotent $e \in R$, one can find rings $R_1$ and $R_2$ such that $R = R_1 \times R_2$ (try using the ideals $eR$ and $(1-e)R$) and such product rings always have nontrivial idempotents. 
Finally show a disconnected spectrum implies the existence of a nontrivial idempotent using some basic properties of closed sets in the spectrum. If $\operatorname{Spec}(R) = V(I)\sqcup V(J)$ then since $V(I) \cap V(J) = V(I+J) = \varnothing$, we must have $I+J=R$ so $1 = e + e' \in I+J$. Further $V(I) \cup V(J) = V(IJ) = \operatorname{Spec}(R)$ so $\forall \mathfrak{p} \in \operatorname{Spec}(R),$ $\mathfrak{p} \supset IJ$, and consequently $IJ \subset \sqrt{(0)}$ the nilradical. Then you can work with $1=e+e'$ and the fact that $ee'$ is nilpotent to get an idempotent after some calculation with binomial coefficients. 
