Solution (source code)

= Solution

Because $H_k$ is <predictable process>[previsible], $H_k$ is $\mathcal F_{k-1}$-measurable. The finite sum $\widehat X_n$ is therefore $\mathcal F_n$-measurable. Boundedness of $H$ and integrability of the martingale increments imply
$$
\mathbb E|\widehat X_n|<\infty.
$$
Finally,
$$
\begin{aligned}
\mathbb E[\widehat X_n-\widehat X_{n-1}\mid\mathcal F_{n-1}]
&=\mathbb E[H_n(X_n-X_{n-1})\mid\mathcal F_{n-1}]\\
&=H_n\mathbb E[X_n-X_{n-1}\mid\mathcal F_{n-1}]\\
&=0.
\end{aligned}
$$
Thus
$$
\mathbb E[\widehat X_n\mid\mathcal F_{n-1}]
=\widehat X_{n-1},
$$
so $\widehat X$ is a martingale. It is the <martingale transform> of $X$ by $H$.