About a spectrum of a C*-algebra Let $A$ be an unital commutative C*-algebra.
Show that the spectrum of $A$ is disconnected iff there is a projection $p \in A$ not trivial.
 A: Let $\Gamma:A\to C(\hat{A})$ be the Gelfand representation (that is, $\Gamma(a)(f)=f(a)$ for $a\in A$ and $f\in\hat{A}$).
First, suppose there exists a non-trivial projection $p$ in $A$. consider the polynomial $P(X)=X(X-1)$. Then
$$P(\sigma(p))=\sigma(P(p))=0,$$
so $\sigma(p)\subseteq P^{-1}(0)=\left\{0,1\right\}$. Also, notice that $p(p-1)=0$, so neither $p$ nor $p-1$ can be invertible, since $p$ is non-trivial. Therefore, $\sigma(p)=\{0,1\}$.
Now, we know that $\left\{0,1\right\}=\sigma(p)=\left\{f(p):f\in\hat{A}\right\}=\Gamma(p)(\hat{A})$. That way, $\Gamma(p)$ is a continuous function in $\hat{A}$ with disconnected image. Thus, $\hat{A}$ has to be disconnected as well.
Conversely, suppose $\hat{A}$ is disconnected, and let $Y$ be a non-trivial clopen subset of $\hat{A}$. The characteristic function $1_Y:\hat{A}\to\mathbb{C}$ ($x\in Y\mapsto 1$, $x\not\in Y\mapsto 0$) is continuous, and it is a non-trivial projection in $C(\hat{A})$. By the Gelfand Representation Theorem, $\Gamma$ is an isomorphism, so there exists $a\in A$ such that $\Gamma(a)=1_Y$, and $a$ must also be a non-trivial projection in $A$.
A: Here is a shorter argument. Since $A$ unital and commutative, we have $A\simeq C(X)$, where $X$ is the spectrum. 
Let $p\in C(X)$ be a nontrivial projection. As $p$ is continuous, the sets $X_0=p^{-1}(\{0\})$ and $X_1=p^{-1}(\{1\})$ are open, and $X=X_0\cup X_1$. So $X$ is disconnected. 
Conversely, if $X$ is disconnected, then $X=X_0\cup X_1$ with $X_0,X_1$ open. Let $p=1_{X_1}$, the characteristic function of $X_1$. Because the possible pre-images of sets by $p$ are $\emptyset, X_0, X_1, X$, which are all open, $p$ is continuous. Thus $p\in C(X)$ and $p\ne0$, $p\ne1$, $p^2=p$, $p^*=p$, as $p$ only takes the values $0,1$. 
