How to prove $$ \mathbb{E}\left[\exp\left(ia\int_0^Tf(t) \, dB_t\right)\right] = \exp\left(-\frac{a^2}{2}\int_0^Tf(t)^2 \, dt\right)? $$
$B_t$ is the Brownian motion, and $E$ is the expectation. $f(t)$ is the simple step function defined by $f(t)=\sum_{i=1}^nb_i1_{(t_{i-1}, t_i]}(t)$ and $\int_0^Tf(t) \, dB_t=\sum_i^nb_i(B_{t_i}-B_{t_{i-1}})$.
The question is based on the top lines of page 144 of https://www.ntu.edu.sg/home/nprivault/MA5182/brownian-motion-stochastic-calculus.pdf. The definition of $f(t)$ is also from its Eq.(4.6).
Let
$$Y = \exp\left(ia\int_{0}^tf(s)\,dB_s+\frac{a^2}{2} \int_0^tf(s)^2 \, ds \right) $$
Apply Ito's rule to $Y_t$
$$dY_t = iaY_tf(t) \, dB_t$$
a drift-less process that leads to $\mathbb{E}[Y_T] = Y_0=1$. Thus,
$$ \mathbb{E}\left[\exp\left(ia\int_{0}^Tf(t) \, dB_t + \frac{a^2}{2} \int_0^Tf(t)^2 \, dt\right)\right]=1$$
or $$\mathbb{E}\left[\exp\left(ia\int_0^Tf(t) \, dB_t \right) \right] = \exp\left(-\frac{a^2}{2} \int_0^Tf(t)^2 \, dt \right) $$