Show that $\int_{-\infty}^{\infty}|f(x)|^2dx = \frac{1}{2\pi}\int_{-\infty}^{\infty}|\hat{f}(\mu)|^2d\mu$ Given: Let $a_1 \lt b_1 \le a_2 \lt b_2 \le ... \le a_{n-1} \lt b_{n-1} \le a_n \lt b_n$ and let $$f(x) = \sum_{j=1}^nc_jf_{a_jb_j}(x).$$
Show that,
$$(*)\int_{-\infty}^{\infty}|f(x)|^2dx = \frac{1}{2\pi}\int_{-\infty}^{\infty}|\hat{f}(\mu)|^2d\mu$$
My intuition is first using the fact that (I proved that):
$$(1)\int_{-\infty}^{\infty}\frac{1-costx}{x^2}dx = |t|\pi \quad,\forall t\in \mathbb R$$
In order to show that:
$$(2)\int_{-\infty}^{\infty}\hat{f}_{a_jb_j}(\mu)\overline{\hat{f}_{a_jb_j}(\mu)}d\mu = 0 \quad for\;i \neq j$$
and then use $(2)$ to show what is required. I'm still not sure how to get from $(1)$ to $(2)$ and from $(2)$ to show $(*)$
My intuition for showing $(2)$ is using:
$$g(\mu) = \hat{f}_{cd}(\mu)\overline{\hat{f}_{ab}(\mu)} = \{\frac{e^{i\mu d}-e^{i\mu c}}{i\mu}\}\{\frac{\overline{e^{i\mu b}-e^{i\mu a}}}{i\mu}\} = \frac{e^{i\mu (d-b)}-e^{i\mu (c-b)}-e^{i\mu (d-a)} + e^{i\mu(c-a)}}{\mu^2}$$
And somehow and exploit the fact that $g(\lambda)$ is holomorphic in $\mathbb C$ and the coefficients of $i\mu$
in the exponential terms in $g(\mu)$ are all nonnegative.
Also, another intuition is showing (still don't know how - would highly appreciate if someone can solve this too) that:
$$(*)(*)\lim\limits_{R \uparrow \infty}\frac{1}{2\pi}\int_{-R}^{R}e^{-i\mu x}\hat{f}_{ab}(\mu)d\mu = f_{ab}(x)$$ and from that to show $(*)$.
where $f_{ab}(x)$ and $\hat{f}_{ab}(\mu)$ are:

Let the Fourier transform $\hat{f}(\mu)$ of a function $f(x)$ specified on $\mathbb R$ is defined (often) by the formula:
$\hat{f}(\mu) = \int_{-\infty}^{\infty}e^{i\mu x}f(x)dx$ for $\mu \in \mathbb C$ whenever the integral makes sense.
Let $f_{ab}(x) = 1$ for $a \le x \le b$ and $f_{ab}(x) = 0$ for $x \neq [a,b]$.
the points $x$ are $\in \mathbb R$ except for $a, b$.
 A: In the notation set above, it is easy to show that, since the rectangular pulses never overlap due to the ordering prescribed:
$$\int_{-\infty}^{\infty}f_{a_j b_j}(x)f_{a_k b_k}(x)dx=(b_j-a_j)\delta_{jk}$$
and the basis of functions chosen is orthogonal. Now, we substitute in the above integral the inverse Fourier transform expression and we swap the order of integration as follows:
$$\int_{-\infty}^{\infty}f_{a_j b_j}(x)f_{a_k b_k}(x)dx=\int \frac{d\mu d{\mu'}}{(2\pi)^2}\hat{f}_{a_j b_j}(\mu)\hat{f}_{a_k b_k}(\mu')\int_{-\infty}^{\infty}e^{i(\mu+\mu')}dx=\frac{1}{2\pi}\int_{-\infty}^{\infty}d\mu\hat{f}_{a_j b_j}(\mu)\hat{f}^*_{a_k b_k}(\mu)$$
where we have used $\int_{-\infty}^{\infty}e^{i\mu x}dx=2\pi\delta(\mu)$ and also the fact that $f_{a_jb_j}(x)$ is real, which implies that $\hat{f}_{a_jb_j}(-\mu)=\hat{f}^*_{a_jb_j}(\mu)$. Now it should be easy to prove Parseval's theorem since:
$$\int_{-\infty}^{\infty}|\hat{f}(\mu)|^2d\mu=\sum_{j=1}^n\sum_{k=1}^{n}c_jc^*_k\int d\mu \hat{f}_{a_j b_j}(\mu)\hat{f}^*_{a_k b_k}(\mu)=2\pi\sum_{j=1}^n\sum_{k=1}^{n}c_jc^*_k\int dx f_{a_j b_j}(x)f_{a_k b_k}(x)\\=2\pi\int dx (\sum_{j=1}^n c_j f_{a_j b_j}(x))(\sum_{j=1}^n c_j f_{a_j b_j}(x))^*=2\pi \int_{-\infty}^{\infty}dx|f(x)|^2$$
and the proposition is proven.(Note that exchanging summation and integration is justified since the summation is finite)
Relation (2) does not need to be proven by explicit calculation to prove (*), due to the nice properties of the Fourier transform. However, if one wants to go the long way, it is not hard to prove by algebraic manipulations on equation (1) that:
$$\int_{-\infty}^{\infty} d\mu \frac{1-\cos\mu t}{\mu^2}e^{-i\mu x}=\pi (|t|-|x|)\mathbb{1}_{|t|\geq|x|}$$
and then one can explicitly evaluate the integral 
$$\int_{-\infty}^{\infty}d\mu \hat{f}_{a_jb_j}(\mu) \hat{f}^*_{a_kb_k}(\mu)=\\2\int_{-\infty}^{\infty}\frac{e^{i\mu \Delta_{jk}/2}}{\mu^2}(\cos(\frac{\mu\Delta_{jk}}{2})-\cos(\frac{\mu S_{jk}}{2}))=\\\pi(|S_{jk}|-|\Delta_{jk}|)\mathbf{1}_{|S_{jk}|-|\Delta_{jk}|\geq 0}=2\pi(b_j-a_j)\delta_{jk}$$
where$$S_{jk}=a_j+a_k-b_j-b_k~~~,~~~ \Delta_{jk}=b_j+a_j-b_k-a_k$$
and the Kronecker delta arises after some mildly tedious case work from the ordering of the partition of the interval $[a,b]$.
A: A pointwise result is typically needed for such a proof. For example,
$$
      \lim_{R\rightarrow\infty}\frac{1}{\sqrt{2\pi}}\int_{-R}^{R}e^{isx}\widehat{\chi_{[a,b]}}(s)ds = \frac{1}{2}(\chi_{[a,b]}(x)+\chi_{(a,b)}(x)) \;\;(*)
$$
The form on the right is a convenient way to express a function that is equal to the mean of the left- and right-hand limits of $\chi_{[a,b]}$ at each point. This is a special case of the pointwise Fourier inversion theorem applied to $\chi_{[a,b]}$.
Equation (*) may be written as
$$
   \lim_{R\rightarrow\infty}\frac{1}{2\pi}\int_{-R}^{R}e^{isx}\int_{a}^{b}e^{-ist}dtds = \frac{1}{2}(\chi_{[a,b]}(x)+\chi_{(a,b)}(x)) \\
  \lim_{R\rightarrow\infty}\frac{1}{\pi}\int_{a}^{b}\frac{e^{iR(x-t)}-e^{-iR(x-t)}}{2i(x-t)}dx= \frac{1}{2}(\chi_{[a,b]}(x)+\chi_{(a,b)}(x)) \\
  \lim_{R\rightarrow\infty}\frac{1}{\pi}\int_{a}^{b}\frac{\sin(R(x-t))}{x-t}dx = \frac{1}{2}(\chi_{[a,b]}(x)+\chi_{(a,b)}(x))
$$
Using this inversion,
\begin{eqnarray*}
   & &\int_{-\infty}^{\infty}\widehat{\chi_{[a,b]}}(s)\overline{\widehat{\chi_{[c,d]}}(s)}ds \\
  & &= \lim_{R\rightarrow\infty}\frac{1}{2\pi}\int_{-R}^{R}
        \int_{a}^{b}\int_{c}^{d}e^{-isx}e^{isy}dxdyds \\
  & &=  \lim_{R\rightarrow\infty}\frac{1}{2\pi}\int_{a}^{b}\int_{c}^{d} \frac{e^{iR(y-x)}-e^{-iR(y-x)}}{i(y-x)}dxdy \\
  & &=  \lim_{R\rightarrow\infty}\int_{a}^{b}\frac{1}{\pi}\int_{c}^{d}\frac{\sin(R(y-x))}{y-x}dxdy \\
  & &= \int_{a}^{b} \chi_{[c,d]}(y)dy
%% = \int_{-\infty}^{\infty}\chi_{[a,b]}(x)\chi_{[c,d]}(x) dx \\
  = \int_{-\infty}^{\infty} \chi_{[a,b]}(x)\overline{\chi_{[c,d]}(x)}dx.
\end{eqnarray*}
In particular, the above is $0$ if $[a,b]\cap [c,d]$ is empty or has zero length. Everything you want follows from the last identity, which is already a special case of what you want to prove.
DETAIL: You want to show that the following converges to $\chi_{[a,b](x)}$ as $R\rightarrow\infty$ for $x\ne a$ and $x\ne b$:
$$
   \frac{1}{\sqrt{2\pi}}\int_{-R}^{R}e^{isx}\widehat{\chi_{[a,b]}}(s)ds \\
 = \frac{1}{2\pi}\int_{-R}^{R} e^{isx}\int_a^b e^{-isu}duds \\ 
 = \frac{1}{2\pi}\int_{a}^{b}\int_{-R}^{R}e^{is(x-u)}ds du \\
 = \frac{1}{\pi}\int_a^b\frac{\sin(R(u-x))}{u-x} du \\
 = \frac{1}{\pi}\int_{a-x}^{b-x}\frac{\sin(Rv)}{v}dv \\
 = \frac{1}{\pi}\int_{R(a-x)}^{R(b-x)}\frac{\sin(w)}{w}dw
$$
If $x < a < b$ or if $a < b < x$, then the above clearly tends to $0$ as $R\rightarrow\infty$ because the upper and lower limits both tend to $\infty$ or both tend to $-\infty$. If $a < x < b$, then the above tends to the improper integral
$$
   \frac{2}{\pi}\int_{0}^{\infty}\frac{\sin(w)}{w}dw = 1.
$$
(You can look up this improper integral in any number of sources.)
A: See the short nice proof in the lecture notes of Piotr Hajlasz at 
http://www.pitt.edu/~hajlasz/Notatki/Harmonic%20Analysis2.pdf
Theorem 2.31
