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 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.)