Let $A$ be a self-adjoint (unbounded) operator in a Hilbert space $H$. In Rudin's book "Functional analysis", theorem 13.30, the following is proven:
There exists a unique spectral resolution $E$ of the identity defined on the Borel sets of $\mathbb{R}$ such that $$A= \int_\mathbb{R} \lambda dE(\lambda).$$
The idea of the proof is as follows: One considers the Cayley-transform $U\in B(H)$ of $A$, and then one considers the spectral resolution $E'$ with $$U = \int_{\sigma(U)}\lambda dE'(\lambda).$$ Then we can define the homeomorphism $$g: \Omega := S^1\setminus \{1\} \to \mathbb{R}: \lambda \mapsto \frac{i(1+\lambda)}{1-\lambda}.$$ Then one checks that $$E(\omega):= E'(g^{-1}(\omega)\cap \sigma(U))$$ where $\omega\subseteq \mathbb{R}$ is Borel, works. This settles the existence.
However, I don't understand how the proof in Rudin's book shows uniqueness (if someone asks for it, I can supply the proof here, but I didn't want to make the post needlessly long). Apparently, the idea is to use uniqueness of the spectral decomposition for the unitary $U$ and then conclude the desired uniqueness from this. Can someone please fill in the details? Thanks in advance for your help.
The point is that you have $g(U)=A$. Then $$ A=\int_{\mathbb R} g(\lambda)\,dE'(\lambda)=\int_{S^1\setminus\{1\}}\lambda\,dE'\circ g^{-1}. $$ More generally, $$ h(A)=\int_{\mathbb R} h\circ g(\lambda)\,dE'(\lambda)=\int_{S^1\setminus\{1\}}h(\lambda)\,dE'\circ g^{-1}. $$ Thus $E=E'\circ g^{-1}$.