Let $T:H\to H$ be a compact selfadjoint operator on a Hilbert space $H$ with $\dim H=+\infty$. Assume that there exists a polynomial $p:\mathbb{R}\to\mathbb{R}$ such that every root of $p$ is real and such that $p(T)=0$. The question is: prove that $0$ is an eigenvalue (in the sense that $\ker T\neq 0$).
I know that, since $T$ is compact and $\dim H=+\infty$, then $0$ is in the spectrum $\sigma(T)$, that means that $T$ is not invertible (in fact otherwise the ball would be compact and this would contradict the infinite dimension of the space). However not even the assumption of being selfadjoint is enough to conclude, in fact for example the operator $T:l^2\to l^2$ defined by $(Tx)_n=\frac{x_n}{n}$ is compact and selfadjoint but also injective, hence $0$ is not an eigenvalue.
I don't know how to use the assumption about the polynomial. Can I decompose it in linear factors as $p(x)=\prod_{i=1}^N(x-\alpha_i)$ ? In such a case we get $\prod_{i=1}^N(T-\alpha_i I_H)=0$ wiht $I_H$ the identity on $H$, but now? How can we proceed? Thank you all!
As you say, decompose the polynomial into linear factors. We have $$ \left(\prod_{i=1}^N (T - \alpha_i I)^{k_i}\right) T^{k_0} = 0 $$ where $\alpha_i \in \Bbb R \setminus \{0\}$. Notably, $\dim \ker(T - \alpha_i I)< \infty$ for all $i$, which means that $\dim \ker \left(\prod_{i=1}^N (T - \alpha_i I)^{k_i}\right) < \infty$. We deduce from this that we must have $k_0 \geq 1$. Moreover, noting that $$ \operatorname{range}(T^{k_0}) \subset \ker \left(\prod_{i=1}^N (T - \alpha_i I)^{k_i}\right) $$ we can conclude that $T^{k_0}$ has finite rank (i.e. finite dimensional range). Thus, $T^{k_0}$ has a non-trivial kernel. Thus, $T$ has a non-trivial kernel.