You can find a counterexample in J. Michael Steele's Stochastic Calculus and Financial Applications on page 196. Here's an essentially equivalent construction.
Let $r(t)$ be any positive continuous function on $[0,1)$ with $\int_0^1 r(s)^2\,ds = +\infty$ (for example, $r(t) = 1/(1-t)$). Set $s(t) = \int_0^t r(s)^2\,ds$ so that $s$ is continuous on $[0,1)$, strictly increasing, and $s(1-) = +\infty$. If we let $Z_t = \int_0^t r(s)\,dW_s$ then $Z_t$ is a time-changed Brownian motion; specifically, $\{Z_{s^{-1}(u)}, 0 \le u < +\infty\}$ is a Brownian motion with respect to the filtration $\{\mathcal{F}_{s^{-1}(u)}, 0 \le u < +\infty\}$. (Observe that $Z_{s^{-1}(u)}$ is continuous with independent Gaussian increments having the correct variances.) Let
$$\tau = \inf \left\{t \in \left[\frac{1}{2}, 1\right] : Z_t = 0\right\}.$$
Since Brownian motion is recurrent, almost surely $Z_{s^{-1}(u)}$ hits 0 for some $u \ge s^{-1}(1/2)$, thus $Z_t$ hits zero for some $t \ge 1/2$. So $\tau < 1$ almost surely. Finally set
$$Y(t,\omega) = \begin{cases} r(t), & 0 \le t \le \tau(\omega) \\ 0, & \tau(\omega) < t \le 1. \end{cases}$$
Note $\int_0^1 Y_t^2\,dt = s(\tau)$. Since $\frac{1}{2} \le \tau < 1$ almost surely, by construction, we have $0 < s(1/2) < s(\tau) < \infty$ almost surely, hence $0 < \int_0^1 Y_t^2\,dt < \infty$ almost surely. And $\int_0^t Y_s\,dW_s = Z_{t \wedge \tau}$ so $\int_0^1 Y_s\,dW_s = Z_\tau = 0$.
Best Answer
Hi,
Here is a theorem that might answer your question (it is coming from Chesnay, Jeanblanc-Piqué and Yor's book "Mathematical Methods for Financial Markets").
It is theorem (11.2.8.1 page 621) here it is :
(edit note : be carefull as mentioned by G. Lowther there's a typo in the book regarding the domain of integration in the conditions over $\psi$ (defined hereafter) )
Let $X$ be an $R^d$ valued Lévy Process and $F^X$ its natural filtration. Let $M$ be an $F^X$-local Martingale. Then there exist an $R^d$-valued predictable process $\phi$ and an predictable function $\psi : R^+ \times \Omega \times R^d\to R$ such that :
-$\int_0^t \phi^i(s)^2ds <\infty$ almost surely
-$\int_0^t \int_{|x|> 1} |\psi(s,x)|ds\nu(dx) <\infty$ almost surely
-$\int_0^t \int_{|x|\le 1} \psi(s,x)^2ds\nu(dx) <\infty$ almost surely
and
$M_t=M_0+ \sum_{i=0}^d \int_0^t \phi^i(s)dW^i_s + \int_0^t \int_{R^d} \psi(s,x)\tilde{N}(ds,dx)$
Where $\tilde{N}(ds,dx)$ is the compensated measure of the Lévy process $X$ and $\nu$ the associated Lévy measure.
Moreover if $(M_t)$ is square integrable martingale then we have :
$E[(\int_0^t \phi^i(s)dW^i_s)^2]=E[\int_0^t \phi^i(s)^2ds]<\infty$
and
$E[(\int_0^t \int_{R^d} \psi(s,x)\tilde{N}(ds,dx))^2]=E[ \int_0^t ds \int_{R^d} \psi(s,x)^2\nu(dx)]<\infty$
and $\phi$ and $\psi$ are essentially unique.
The theorem is not proved in the book but there is a reference to the following parpers :
1/H. Kunita and S. Watanabe. On square integrable martingales. Nagoya J. Math., 30:209–245, 1967
2/H. Kunita. Representation of martingales with jumps and applications to mathematical finance. In H. Kunita, S. Watanabe, and Y. Takahashi, editors, Stochastic Analysis and Related Topics in Kyoto. In honour of Kiyosi Itô, Advanced studies in Pure mathematics, pages 209–233. Oxford University Press, 2004.
Regards