Spectrum of projection

Martini's answer is the canonical one. But in this case one can check things explicitly:

We can assume that $A$ is unital, as we can always work on the unitization (we actually need it to define the spectrum).

If $p=I$ of $p=0$, it is straightforward to check that the spectra are respectively $\{1\}$ and $\{0\}$.

For non-trivial $p$: If $\lambda=0$, $p$ is not invertible, because $p(I-p)=0$. Similarly, $I-p$ is not invertible.

For $\lambda\not\in\{0,1\}$, one can check directly that $$ (p-\lambda I)^{-1}=\frac1{\lambda(1-\lambda)}\,p-\frac1\lambda\,I. $$ So $\sigma(p)=\{0,1\}$.


We can say that $\sigma(p) \subseteq \{0,1\}$. $p - p^2 = 0$, and hence, by the spectral theorem $$ \{0\} = \sigma(0) = \{\lambda - \lambda^2 \mid \lambda \in \sigma(p) \}$$