Framework:
Consider a unital ring: $e\in R$
and a given polynomial: $p\in R[X]$
(Note that I do not require the ring to be an integral domain.)
Problem:
If it has a root then it factorizes: $p(\lambda)=0 \Rightarrow p=(X-\lambda)q$
Application:
Consider a unital algebra: $\mathcal{A}$
over the complex numbers: $R=\mathbb{C}$
For a given element: $A\in\mathcal{A}$
and investigate its spectrum: $\sigma(A)$
Then the spectral theorem holds: $\sigma(p(A))=p(\sigma(A))$
Discussion:
Intermediate within the proof the assertion arises that at least one factor cannot be invertible:
$$\mu\in\sigma(p(A))\Rightarrow \lambda_{i_0}\in\sigma(A)\qquad\text{ with }\mu-p(A)\propto(\lambda_1-A)\cdots(\lambda_{I}-A)$$
So one might wonder wether all roots necessarily belong to the spectrum:
$$\mu\in\sigma(p(A))\Rightarrow\lambda_1,\ldots\lambda_I\in\sigma(A)$$
Moreover what happens if the field is not algebraically closed as in the reals: $R=\mathbb{R}$
Can it happen in this case that the inclusion becomes proper: $\sigma(p(A))\supsetneq p\sigma(A))$
Solution:
By polynomial division it has a representation as: $$p=(X-\lambda)q+r\qquad{deg}(r)<1$$ Evaluation yields: $$0=p(\lambda)=(\lambda-\lambda)q(\lambda)+r(\lambda)=0+c_0\qquad r=c_0X^0$$ That is: $r=0$
Concluding: $p=(X-\lambda)q$