Consider a predictable process $H_t$ and a continuous local martingale $M_t$ for $t \in [0,T]$
I want to show that $$X_t:=\left(\int_0^t H_s dM_s\right)^2 - \int_0^t H^2_s d \langle M_s\rangle $$ is a local martingale. When I take a localizing sequence $\{\tau_k\}_{k \in \mathbb{N}}$, $\int_0^t H_s d(M_s\wedge \tau_k)$ is a square integrable martingale. Ito-isometry state that
$$E\left[\left(\int_0^t H_s d(M_s\wedge \tau_k\right)^2\right] =E\left[ \int_0^t H_s^2 d\langle M_s \wedge \tau_k\rangle\right] $$
Therefore taking the expectation in the first equation, I get $E[X_{t\wedge \tau_k}]=0$
Therefore $E[X_{t \wedge \tau_k}]= E[X_0]=0$
Optinal sampling states that then $X_{t \wedge \tau_k}$ is martingale and hence $X_t$ a local martingale. Am I right?