Theorem: Let $T$ be a bounded self-adjoint operator on a complex infinite dimensional Hilbert space H. Then $T$ is compact if and only if $\sigma_{\mathrm{ess}}(T)=\{0\}$.
Proof: If $T$ is compact then by Hilbert-Schmidt I know that $\sigma_{\mathrm{ess}}(T)\subset\{0\}$. Furthermore if $E$ is the spectral resolution of $T$ then for all $\varepsilon>0$ we have $$I-(E_\varepsilon-E_{-\varepsilon})\leq E(\{\lambda:|\lambda|>\varepsilon/2\})$$ but since $T$ is compact the operator $E(\{\lambda:|\lambda|>\varepsilon/2\})$ has finite range. So $\mathrm{rg}(I-(E_\varepsilon-E_{-\varepsilon}))=\ker(E_\varepsilon-E_{-\varepsilon})$ is finite dimensional but $$H=\ker(E_\varepsilon-E_{-\varepsilon})\oplus\mathrm{rg}(E_\varepsilon-E_{-\varepsilon}),$$ thus $\mathrm{rg}(E_\varepsilon-E_{-\varepsilon})=\infty$ and $$0\in\sigma_{\mathrm{ess}}(T).$$
I do not know how to proof the converse. I think I can use the following: $$T\text{ is compact if and only if for all }\varepsilon>0,\text{ }\dim(\mathrm{rg}(E_\varepsilon-E_{-\varepsilon}))<\infty.$$
Can someone give me an idea? Thank you!
Remark: Here $E_\lambda:=E((-\infty,\lambda])$ for all $\lambda\in\mathbb{R}$.
Suppose that $\sigma_{\mathrm{ess}}(T)=\{0\}$. So, zero is the only one possible accumulation point.
Thus if $\sigma_d(T)$ is finite then $E(\{\lambda\in\mathbb{R}:|\lambda|>\varepsilon\})$ has finite range because it is sum of projections on finite dimensional subespaces of $H$.
In the same way, if $\sigma_d(T)$ is infinite then $E(\{\lambda\in\mathbb{R}:|\lambda|>\varepsilon\})$ has finite range because $\{\lambda:|\lambda|>\varepsilon\}$ contains only finite eigenvalues of finite multiplicity because $T$ is bounded.