How to prove the following $L^2$ convergence I have encountered this several times, but have no idea why its true.
Let $(\Omega,\mathcal{F},P)$ be a probability space. Let $H(s,\omega): [0,t]\times \Omega\rightarrow \mathbb{R}$ be $\mathscr{B}[0,t]\times \mathcal{F}$ measurable. Moreover, for each fixed $\omega\in \Omega$, $H(s,\omega)$ is continuous on $[0,t]$. We assume that
\begin{align*}
E\int_0^t H(s,\omega)^2\ ds < \infty
\end{align*}
Define $H_n(s,\omega)$ as
\begin{align*}
\textstyle H_n(s,\omega)= H(\frac{kt}{n}, \omega), \qquad \frac{kt}{n}\leq s< \frac{(k+1)t}{n}, 0\leq k\leq n-1
\end{align*}
Then we have
\begin{align*}
\lim_{n\rightarrow\infty}E\int_0^t (H_n(s,\omega)- H(s,\omega))^2\ ds= 0
\end{align*}
It's clear that $H_n\rightarrow H$ a.s. We can't apply dominated convergence since this is Riemann type approximation. I tried to prove the sequence $H_n$ is cauchy in $L^2$, but it seems does not work. Does anyone have any idea or comments?
 A: It's not true --- the problem is you are being too specific about your grid/partition.
Let $A \in \mathbb{N}$ be a random variable with $\mathbb{P}\{A = n\} = \frac{c}{n^{2}}$.  (We need $c = \frac{6}{\pi^{2}}$ for this to make sense.)
Next, fix a smooth function $\varphi : \mathbb{R} \to \mathbb{R}_{\geq 0}$ such that $\int_{\mathbb{R}} \varphi(x)^{2} \, dx = 1$ and $\varphi(0) = \|\varphi\|_{L^{\infty}(\mathbb{R})} = 1$, and let $H : [0,1] \to \mathbb{R}_{\geq 0}$ be given by
\begin{equation*}
H(s) = \sqrt{2^{A + 1}} \varphi(2^{A + 1}(s - A^{-1}))
\end{equation*}
Notice that
\begin{align*}
\mathbb{E} \left( \int_{0}^{1} H(s)^{2} \, ds \, \mid \, A \right) \leq \int_{-1}^{1} \varphi(u)^{2} \, du = 1.
\end{align*}
so $\mathbb{E} \left( \int_{0}^{1} H(s)^{2} \, ds \right) < \infty$.  (Here I am using $t = 1$.)
On the other hand, $H_{A}$ has the property that, on the event $\{A \geq 2\}$,
\begin{equation*}
\mathbb{E}\left( \int_{0}^{1} H_{A}(s)^{2} \, ds \, \mid \, A \right) \geq   2^{A + 1} A^{-1}.
\end{equation*}
Hence, for each $n \in \mathbb{N} \setminus \{1\}$,
\begin{equation*}
\mathbb{E}\left(\int_{0}^{1} H_{n}(s)^{2} \, ds\right) \geq \mathbb{E}\left(\int_{0}^{1} H_{n}(s)^{2} \, \mid \, A = n\right) \mathbb{P}(A = n) \geq c 2^{n + 1} n^{-3}
\end{equation*}
This proves that $\lim_{n \to \infty} \mathbb{E} \left( \int_{0}^{1} H_{n}(s)^{2} \, ds \right) = \infty$.
Having said that, given an $H$ as in the original question, we can approximate by step functions using the definition $(H_{n})_{n \in \mathbb{N}}$
\begin{align*}
H_{n}(s) = n \int_{\frac{\lfloor ns \rfloor}{n}}^{\frac{\lfloor ns \rfloor + 1}{n}} H(\xi) \, d \xi.
\end{align*}
Using Jensen's inequality, we find
\begin{equation*}
\sup \left\{ \int_{0}^{t} H_{n}(s)^{2} \, ds \, \mid \, n \in \mathbb{N} \right\} \leq \int_{0}^{t} H(s)^{2} \, ds.
\end{equation*}
Thus, by the dominated convergence theorem, $\lim_{n \to \infty} \mathbb{E} \left( \int_{0}^{t} |H_{n}(s) - H(s)|^{2} \, ds \right) = 0$.
A: Since $s \mapsto H(s, \omega)$ is continuous on a compact set, it is uniformly continuous by Heine-Cantor's theorem. Then, $H_n(s, \omega) \to H(s, \omega)$ uniformly and the result follows.
Comment. I went to check my old notes. This result holds if we assume that $H$ is bounded. When, $H$ is not bounded, one can show the existence of a a sequence of simple processes that approximate $H$ in $L^2$ but that construction is existencial (only shows existence via a compacteness/diagonalisation argument). I could not find anywhere in my books or notes how to deal with the case of a continuous unbounded $H$ and I suspect that the explicit sequence may fail in that case. By the way, por a typical process (without continuity assumptions) one simply "localises" $H$ by considering $H^M = H \mathbf{1}_{\{|H| \leq M\}}$ (this, of course, it is not continuous unless $H$ is bounded by $M$).
