Compensator for $\bigg(\int_0^t f(s)dB(s)\bigg)^2$. Let $\{B(t)\}_{t\geq 0}$ be a brownian motion, $ \{\mathcal F_t\}_{t\geq 0}$ an admissible filtration for the BM.
Let $f$ be an $\mathcal F_t$-adapted function satisfying $\mathbb E \int_a^b f(s)^2ds <\infty$
Now I define $M_t$ to be the following stochastic process
$$M_t=\int_0^t f(s) dB(s), \\ a\leq t\leq b$$
It's clear that under our assumptions $M_t$ is a martingale and by Jensen's inequality for conditional expectations we have that  $M_t^2$ is a sub-martingale.
Then using Ito's formula we obtain the following
$$M^2_t=\color{red}{2\int_0^t M_s f(s)dB(s)}+\color{green}{\int_0^t f(s)^2 ds}$$
now, clearly the second term is an increasing process, so I am tempted to say that it's the compensator for the sub-martingale $M^2_t$, but nonetheless to claim that I would need the first term to be a martingale, namely the above expression needs to be the Doob-Meyer decomposition.
But to be honest it's not clear to me whether or not $2\int_0^t M_s f(s)dB(s)$ is a martingale.
I know that it would suffice to prove that 
$$\mathbb E \int_a^b M_s^2 f(s)^2 ds<\infty$$
But so far I haven't been able to do so.
I would appreciate any help.
 A: If the function $f$ is bounded, then it follows from Itô's formula that $$\mathbb{E} \int_a^b M_s^2 f(s)^2 \, ds < \infty, \tag{1}$$ and therefore the stochastic integral $\int_0^t M_s f(s) \, dB_s$ is a martingale. If $f$ is unbounded, then the situation is more difficult. Somehow, $(1)$ is a too strong condition since $(1)$ actually implies that the stochastic integral is an $L^2$-martingale (which we cannot expect in general; square integrability may fail).
For a general function $f$ (satisfying $\mathbb{E}\int_0^t f(s)^2 \, ds < \infty$) define $$f_n := (-n) \vee f \wedge n.$$ It follows from the dominated convergence theorem that $$\mathbb{E} \int_0^t |f_n(s)-f(s)|^2 \, ds \xrightarrow[]{n \to \infty} 0,$$ and so $$\lim_{n \to \infty} \underbrace{\int_0^t f_n(s) \, dB_s}_{=:M_t^{(n)}} = \underbrace{\int_0^t f(s) \, dB_s}_{=:M_t}\quad \text{in $L^2$}.$$ This entails that
$$(M_t^{(n)})^2 - \int_0^t f_n(s)^2 \, ds \to M_t^2 - \int_0^t f(s)^2 \, ds \quad \text{in $L^1$}$$
for each $t >0$. Since $f_n$ is bounded, we know from our earlier consideration that $(M_t^{(n)})^2 - \int_0^t f_n(s)^2 \, ds$ is a martingale (w.r.t the canonical filtration of Brownian motion), and so is the $L^1$-limit $(M_t^2 - \int_0^t f(s)^2 \, ds)$. 
