Prove that $ \mathsf{E}[g(X)] = \int_{- \infty}^{\infty} G(t) \varphi(t) \, d{t} $. 
Problem
Let $ X $ be a real-valued random variable with characteristic function $ \varphi $. Suppose that $ g: \mathbb{R} \to \mathbb{R} $ satisfies
  $$
\forall x \in \mathbb{R}: \quad g(x) = \int_{- \infty}^{\infty} G(t) e^{i t x} \, d{t}
$$
  for some measurable function $ G: \mathbb{R} \to \mathbb{C} $ such that
  $$
\| G \|_{{L^{1}}(\mathbb{R})} := \int_{- \infty}^{\infty} \left| G(t) \right| \, d{t}
                               < \infty.
$$
  Then prove that
  $$
\mathsf{E}[g(X)] = \int_{- \infty}^{\infty} G(t) \varphi(t) \, d{t}.
$$

My attempt:
By the definition of expectation, we have
$$
  \mathsf{E}[g(X)]
= \int_{- \infty}^{\infty}
  \left[ x \int_{- \infty}^{\infty} G(t) e^{i t x} \, d{t} \right] \, d{x}.
$$
However, I am not sure how to proceed from here. Does it have anything to do with expressing $ e^{i t x} $ as $ \cos(t x) + i \sin(t x) $?
 A: Let $ P $ denote the probability distribution of $ X $ and $ \mu $ the Lebesgue measure on $ \mathbb{R} $. Then
\begin{align*}
   \mathsf{E}[g(X)]
&= \int_{\mathbb{R}} g(x) \, d{P(x)} \\
&= \int_{\mathbb{R}}
   \left[ \int_{\mathbb{R}} G(t) e^{i t x} \, d{\mu(t)} \right]
   d{P(x)} \\
&= \int_{\mathbb{R}}
   \left[ \int_{\mathbb{R}} G(t) e^{i t x} \, d{P(x)} \right]
   d{\mu(t)}
   \quad (\text{By Fubini's Theorem.}) \\
&= \int_{\mathbb{R}}
   \left[ G(t) \int_{\mathbb{R}} e^{i t x} \, d{P(x)} \right]
   d{\mu(t)} \\
&= \int_{\mathbb{R}} G(t) \mathsf{E} \left[ e^{i t X} \right] \, d{\mu(t)} \\
&= \int_{\mathbb{R}} G(t) {\varphi_{X}}(t) \, d{\mu(t)}.
   \quad (\text{By the definition of $ \varphi_{X} $.})
\end{align*}
Our application of Fubini’s Theorem is valid because $ |G(t) e^{i t x}| = |G(t)| $ for all $ (x,t) \in \mathbb{R}^{2} $, which implies that
\begin{align*}
   \int_{\mathbb{R}^{2}} |G(t) e^{i t x}| \, d{(P \otimes \mu)(x,t)}
&= \int_{\mathbb{R}^{2}} |G(t)| \, d{(P \otimes \mu)(x,t)} \\
&= \left[ \int_{\mathbb{R}} 1 \, d{P(x)} \right]
   \left[ \int_{\mathbb{R}} |G(t)| \, d{\mu(t)} \right] \\
&= 1 \cdot \| G \|_{{L^{1}}(\mathbb{R})} \\
&< \infty.
\end{align*}
