This question is duplicate of the question Find projection-valued measure associated with parity operator.\
But in that question @Jacky Chong does not state how he found the operator \begin{align} P_\pi(\lambda) =P_{\pi}((-\infty,\lambda]) =\delta(\lambda-1)P_\text{even}+\delta(\lambda+1)P_\text{odd} \end{align}
Also we know that $P(R)=Id \enspace$ or we should have $P(\lambda_1)\leq P(\lambda_2)$ for $\lambda_1 < \lambda _2$ but if we put 2 and 1 into the $P_{\pi}$ we get $0:L^2\rightarrow L^2$ and $P_{even}$ resp.
My question is could someone explain me how to find $P_{\pi}$ explicitly using maybe Stieltjes inversion formula or something else
Notes:
(1) I need 50 reps to comment on the problem i linked
(2) I already found the spectrum and resolvent of parity operator.They're $$\sigma(\Pi)=\{1,-1\} \enspace R_{\Pi}(z)=\frac{\Pi+zI}{1-z^2}$$
(3) This is Problem 3.2 from Teschl G. - Mathematical methods in quantum mechanics
This is simply the standard way of writing a finite sum as an integral relative to a corresponding atomic measure. In particular: if the operator in question can be written as a countable sum $$ A = \sum_i \lambda_i P_i $$ (with the $P_i$ equal to spectral projectors and hence mutually orthogonal and "complete"), then the measure associated with $A$ can be written as $$ P_A(\lambda) = \sum_i \delta(\lambda - \lambda_i)P_i. $$ To see that this works, it suffices to show that for a Borel function $f$, $f(A)$ is indeed equal to $\int_{\Bbb R} f(\lambda) \,dP_{A}(\lambda)$. In other words, this is simply a consequence of the fact that $$ f\left(\sum_i \lambda_i P_i\right) = \sum_i f(\lambda_i) P_i. $$