The spectral theorem for unbounded operators says that if $A:D(A)\subset H\to H$ is a densely defined self-adjoint operator ($H$ Hilbert), and $f:\mathbb{R}\to \mathbb{R}$ is a Borel function bounded on $\sigma(A)$ then $$f(A) = \int_{\mathbb{R}} f(\lambda) dP(\lambda)$$ where $dP(\lambda)$ is the spectral measure of $A$.
I naively thought that the spectrum of $f(A)$ is given by $f(\sigma(A))$ but then I came across the following. Let $A = -\Delta: D(\Delta) \to L^2(\mathbb{R}^3)$, where $\Delta$ is the Laplacian. It is well known that $\sigma(A)= [0,+\infty)$. Let $\rho < 0$, then we can consider the self-adjoint operator $$(A-\rho)^{-1} = \int_{0}^{+\infty} (\lambda-\rho)^{-1}dP(\lambda)$$ This operator is the inverse of $A-\rho$, and by our naive assumption its spectrum should be $\frac{1}{\sigma(A)-\rho}$. But from other theories we also know that the inverse $(A-\rho)^{-1}$ is a compact self-adjoint operator and thus its spectrum must be a discrete set (contradiction).
The apparent contradiction lies in the fact that the Laplacian $(-\Delta,D(\Delta))$ has compact resolvent only when $D(\Delta)$ is a dense subspace of $L^2(\Omega)$ with $\Omega\subset \mathbb{R}^N$ open and bounded, by the Rellich-Kondrachov theorem.
On the other hand, the result $\sigma(-\Delta)=[0,+\infty)$ refers to the case where $\Omega=\mathbb{R}^N$. In this case, the resolvent $(-\Delta-\rho)^{-1}$ is not compact.