Intuition/Motivation behind resolutions to the identity In Functional Analysis by Rudin the theory of bounded linear operators on Hilbert space is developed. 
All of a sudden (at least to me) a resolution to the identity is introduced, which is a function from a sigma algebra to the space of bounded linear operators ${\cal B}(H)$ which satisfies the conditions given in this link.
Is there any process of reasoning which would lead one to defining such a map? Alternatively, is there a perspective in which this map is a natural one to define? 
 A: A primary example in Spectral Theory involves the differentiation operator
$$
                       Af = \frac{1}{i}\frac{df}{dt}
$$
on absolutely continuous functions $f \in L^2[-\pi,\pi]$ such that $f(-\pi)=f(\pi)$. In this example, there is a discrete decomposition of the space $L^2$ as
$$
         g = \sum_{n=-\infty}^{\infty}\frac{1}{2\pi}\langle g, e^{inx}\rangle e^{inx}.
$$
Each operator $P_n$ defined by $P_n g= \frac{1}{2\pi}\langle g,e^{inx}\rangle e^{inx}$ is an orthogonal projection of $g$ onto the subspace spanned by $e^{inx}$, which is the eigenspace of $A$ associated with eigenvalue $n$. In operator notation,
$$
           AP_n = \lambda_n P_n,\;\; \lambda_n=n.
$$
One has a complete expansion of everything in $L^2$ as a Fourier series that converges in $L^2$:
$$
           f = \sum_{n=-\infty}^{\infty}P_n f.
$$
In other words $I=\sum_{n=-\infty}^{\infty}P_n$ holds in a vector (strong) sense, and $A=\sum_{n=-\infty}^{\infty}\lambda_n P_n$, with strong convergence for some $f\in L^2$ iff $f\in \mathcal{D}(A)$. Higher order powers of $A$ are similarly represented as $A^kf =\sum_{n=-\infty}^{\infty}\lambda_n^k P_nf$.
Another primary example in Spectral Theory involves $Af=\frac{1}{i}\frac{df}{dt}$ on $L^2(\mathbb{R})$. In this example there are no eigenfunctions because $e^{isx}$ is not in $L^2$. However, there is still an expansion in terms of "continuous" spectrum (this example is where the term continuous spectrum originated.) In this example, one has something analogous to a sum:
$$
           f =\frac{1}{2\pi}\int_{-\infty}^{\infty}\langle f,e^{i\lambda t}\rangle e^{i\lambda x} d\lambda
$$
There is some abuse in this notation because $e^{i\lambda t}$ is not in $L^2$, which means the inner product notation is not really an inner product. But the notation is compellingly suggestive. What's interesting about this example is that an integral over a finite interval $I=[a,b]$ is an orthogonal projection:
$$
  P[a,b] f = \frac{1}{2\pi} \int_{a}^{b}\langle f,e^{i\lambda t}\rangle e^{i\lambda x}d\lambda
$$
And, there are projections onto approximate eigenspaces in the precise sense that
$$
                \|AP[\lambda-\epsilon,\lambda+\epsilon]f-\lambda P[\lambda-\epsilon,\lambda+\epsilon]f\| \le \epsilon\|f\|.
$$
Intuitively, $AdP(\lambda)=\lambda dP(\lambda)$. The following can be made precise in a vector (i.e., strong) sense:
$$                 I = \int_{-\infty}^{\infty} \lambda dP(\lambda)f \\                 
                  Af = \int_{-\infty}^{\infty}\lambda dP(\lambda)f \\
                  A^{n}g = \int_{-\infty}^{\infty}\lambda^{n} dP(\lambda)f
$$
These are the original motivating examples for spectral integral decompositions. The integrals are not treated as spectral integrals involving measures, but originally were treated as Riemann-Stieltjes integrals with respect to the increasing operator projection $P(t) = P(-\infty,t]$. General cases allow for any orthogonal operator valued function that is increasing in $t$, and incorporate all the types of spectrum into one such function. The idea is that $P(t+\epsilon)-P(t-\epsilon)$ has a range that is very nearly (if not exactly) an eigenspace of $A$ with eigenvalue $t$. This leads to orthogonal, near eigenvalue expansions that generalize what you've seen for matrices, and it leads to a completeness statement that looks like a general Parseval identity:
$$
               \|f\|^2 = \int_{-\infty}^{\infty} d\|P(t)f\|^2
$$
It turns out that all selfadjoint operators can be "diagonalized" in this continuous sense in the same way that matrices have discrete eigenvector expansions. The spectral integral reduces to a discrete sum when applied to selfadjoint matrices over a finite-dimensional space. The generalization is made through mutually orthogonal "approximate eigenspaces."
