Proof (spectral mapping theorem)
If $\deg p = 0$, say $p(z) = a_0$, then $σ(p(T)) = σ(a_0 \id) = \set{a_0} = p(σ(T))$.
Otherwise suppose $\deg p =: d \geq 1$. Let $λ\in \C$. Factorise $$ \begin{align*} λ - p(z) = c \prod_{n=1}^{d} (μ_n - z) \end{align*} $$ into linear factors, where $c, μ_1, \ldots, μ_d \in \C$, $c\neq 0$. Note that $p(z) = λ \iff z \in \set{μ_1, \ldots, μ_d}$.
Then $$ \begin{align*} λ\in σ(p(T)) &\iff λ\id - p(T) \not\in \mathcal{G}(X) \\ &\iff c \prod_{n=1}^{d} (μ_n\id - T) \not\in \mathcal{G}(X) \\ &\xLeftrightarrow{(*)} \exists n: μ_n \id - T \not\in \mathcal{G}(X) \\ &\iff \exists n: μ_n \in σ(T) \\ &\iff λ\in p(σ(T)). \end{align*} $$ To show $(*)$, note the factors $(μ_n\id - T)$ pairwise commute. Then apply this result: