I am reading through the proof of the following in Aupetit's A Primer on Spectral Theory.
Let $f$ be an analytic function from a domain $D$ of $\mathbb{C}$ into a Banach algebra $A$. Suppose that $\text{Sp}(f(\lambda)) \subset \mathbb{R}$ for all $\lambda \in D$, then $\text{Sp}(f(\lambda))$ is constant on $D$.
I was able to prove that $E$ is closed in $D$, but I fail to see why $E$ is open. Can anyone please help explain to me why this is true?

That is exactly what is shown in the part of the proof that precedes the definition of $E$: for some positive $\delta$, the $\delta$-neighborhood of $\lambda_0$ is in $E$, as $Sp f(\lambda)$ is constant there.