Uniqueness spectral decomposition unbounded self-adjoint operator 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.
 A: This is a bit subtle. Recall the following result:

If $T\in B(H)$ is a normal operator, there exists a unique resolution
of the identity $E$ on the Borel subsets of $\sigma(T)$ which
satisfies $$T = \int_{\sigma(T)} z dE(z).$$

As a consequence of this, let us prove the following:

If $U\in B(H)$ is a unitary operator such that $1-U$ is injective, then there exists a unique spectral resolution of the identity $E'$ on the Borel subsets of $\Omega:=S^1\setminus \{1\}$ such that
$$U = \int_{\Omega} z dE'(z).$$

Proof: Uniqueness: Let $E''$ be another spectral resolution of the identity on the Borel subsets of $\Omega$ with $U = \int_\Omega z dE''(z)$. Then for $f\in C_0(\Omega)$ and $x,y\in H$, the Stone-Weierstrass theorem implies that
\begin{align*}\int_\Omega f(z)dE'_{x,y}(z)=\langle f(U)x,y\rangle = \int_\Omega f(z) dE''_{x,y}(z) \end{align*}
so that by the Riesz representation theorem $E'_{x,y}= E_{x,y}''$. Hence, $E'= E''$.
Existence: Given a Borel subset $A\subseteq \Omega$, define $E'(A) = E(A \cap \sigma(U))$ where $E$ is the spectral resolution associated with $U$.
Then $E'$ works. Note that $E'(\Omega \setminus \sigma(U)) = 0$.
We distinguish two cases:
(1) $1 \notin \sigma(U)$ so that $\sigma(U) \cap \Omega = \sigma(U)$.
$$\int_\Omega z dE'(z) = \int_{\sigma(U)} z dE(z) = U.$$
(2) $1\in \sigma(U)$. Then using that $E(\{1\})= 0$ (here we use the assumption that $1-U$ is injective, so that $1$ is no eigenvalue of $U$), we get
$$\int_\Omega z dE'(z) = \int_{\sigma(U)\setminus \{1\}} z dE(z) = \int_{\sigma(U)} z dE(z) = U.$$
This ends the proof.

Having established this, it is now easy to prove the uniqueness you are after. What Rudin is really using is the uniqueness of the spectral measure on $\Omega$, instead of on the spectrum $\sigma(U).$
Indeed, recall first that if $A$ is a self-adjoint unbounded operator on $H$, then its Cayley transform $U$ is a (bounded) unitary operator such that $1-U$ is injective. Thus, we have $$U = \int_{\Omega} z dE'(z)$$ for a unique resolution of the identity $E'$ on the Borel subsets of $\Omega$.
Assume now that $A = \int_\mathbb{R} t dE(t)$ where $E$ is a resolution of the identity on the Borel subsets of $\mathbb{R}$. Consider the homeomorphisms
$$f: \Omega \to \mathbb{R}: z \mapsto \frac{i(1+z)}{1-z}, \quad g: \mathbb{R}\to \Omega: t \mapsto \frac{t-i}{t+i}.$$
Consider the resolution of the identity $F$ defined on Borel subsets of $\Omega$ by
$$F(A) := E(f(A)).$$
Then we have
$$\int_\Omega z dF(z) = \int_\Omega g(z) dE(z)= U= \int_\Omega z dE'(z)$$
so that $F= E'$. Then
$$E(A) = F(g(A)) = E'(g(A))$$
so $E$ is uniquely determined.
A: 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}$.
