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).
So, where have I made a mistake?