Let $A$ be a Banach algebra. Suppose that the spectrum of $x\in A$ is not connected. Prove that $A$ contains a nontrivial idempotent $z$. While trying to solve the exercise below, I came up with a wrong conclusion, but I can't see why it's wrong. Also I'm accepting suggestions to get the right solution. This is the problem 17 from chapter 10 of Rudin's Functional Analysis.


Let $A$ be a Banach algebra. Suppose that the spectrum of $x\in A$ is not connected. Prove that $A$ contains a nontrivial idempotent $z$.


My attempt: Let $F_1, F_2$ be two disjoint closed non-empty sets in $\sigma(x)$ such that $F_1\cup F_2 = \sigma(x)$. There is a function $f$ defined over a neighborhood $\Omega$ of $\sigma(x)$ such that $f=1$ in $F_1$ and $f=0$ in $F_2$. Denote $$\tilde{f}(x) = \frac{1}{2\pi i}\int_\Gamma f(\lambda)(\lambda e-x)^{-1}\ d\lambda,$$
which comes from the functional (or symbolic) calculus. $\Gamma$ is a contour of $\sigma(x)$ in $\Omega$.
The idea is to show that $\tilde{f}(x)$ is idempotent. This idea of proof was used in some books and I'm trying to follow it. My problem is this: it's clear that $f(\sigma(x)) = F_1$ from the very definition of $f$. I also know that $\sigma(\tilde{f}(x)) = f(\sigma(x)) = F_1$. But from this post, for instance, we have that the spcetrum of idempotents elements is $\{0,1\}$. If $\tilde{f}(x)$ would be idempotent, then $F_1=\{0,1\}$, but this is not necessarily the case.
Thank you for your help.  
 A: I don't know why you say that $f(\sigma(x))=F_1$. A point in $\sigma(x)$ is either in $F_1$ or in $F_2$, and so $f(x)$ is either $0$ or $1$; and then $f(\sigma(x))=\{0,1\}$. 
A: For a more abstract solution I recommend the book
Banach Algebras and Several Complex Variables written by John Wermer
https://books.google.com/books?id=cCoBCAAAQBAJ&pg=PA20
Given $\sigma(x)$ is not connected, we decompose it as a pairwise disjoint union of non-empty compact sets
\begin{align}
 \sigma(x) =\sigma_1(x)\cup \sigma_2(x)  
\end{align}
Pick pairwise disjoint open sets $\Omega_i$ such that $\sigma_i(x)\subseteq \Omega_i$ and $\sigma(x)\subseteq \Omega =\Omega_1\cup \Omega_2$. Define $\chi_i: \Omega\mapsto \{0,1\}$
\begin{align}
 \chi_i(\xi) = \left\{ \begin{matrix}
 1& \xi \in \Omega_i \\ 0 & \xi\in \Omega\setminus \Omega_i
 \end{matrix}  \right.
\end{align}
The $\chi_i$ defined above is holomorphic and idempotent functions over $\Omega$, and we claim that the following is the non-trivial idempotent element in $A$
\begin{align}
 \Phi_i  = \frac{1}{2\pi i} \int_{\Gamma} \chi_i(\lambda) \left(\lambda e -x \right)^{-1} d\lambda
\end{align} 
where $\Gamma$ is any contour that surrounds $\sigma(x)$ in $\Omega$. Notice $\chi_i^2(\xi) = \chi_i(\xi), \chi_i(\xi)\chi_j(\xi)=0, i\neq j\forall \xi\in \Omega$, which implies $\Phi_i \Phi_i =\Phi_i, \Phi_i \Phi_j =0$.  Further, by theorem 10.28 in  Rudin's Functional Analysis, we know both $\Phi_i$ is not invertible since $\chi_i(\lambda)=0, \lambda\in \sigma(x)\setminus \sigma_i(x)$. Therefore, both $\Phi_i$ are not $e$, then we know they are nontrivial by the fact that $\Phi_1+\Phi_2= \Phi_x(1) =e$.
Pick $z=\Phi_1$, notice $\Phi_1+\Phi_2= \Phi_x(1) =e$ which implies that $\forall x \in A, \left(\Phi_1+\Phi_2 \right)x=x$, which is to say $\forall x\in A$ can be uniquely decomposed as $x=\Phi_1 x +\Phi_2 x$,\footnote{The uniqueness also comes from the fact that $A_1\cap A_2=\{0\} $ since $x\in A_1\cap A_2 \Rightarrow zx=x=0$.} and since $z\Phi_1 x=zx=\Phi_1x, z\Phi_2 x=0$ we know $A=A_1\oplus A_2$.   
