[step:Set up the orthogonality assumption and define the finite variation process $X$]Since $L^2(M)$ is a Hilbert space (it inherits completeness from $L^2(\Omega \times [0,\infty), \mathcal{P}, d\mathbb{P} \otimes d\langle M \rangle)$), density of $\mathcal{E}$ in $L^2(M)$ is equivalent to $\mathcal{E}^\perp = \{0\}$. Suppose $K \in L^2(M)$ satisfies
\begin{align*}
(K, H)_{L^2(M)} := \mathbb{E}\!\left[\int_0^\infty K_s H_s \, d\langle M \rangle_s\right] = 0 \quad \text{for all } H \in \mathcal{E}.
\end{align*}
We must show $K = 0$ in $L^2(M)$, i.e., $\|K\|_{L^2(M)}^2 = \mathbb{E}[\int_0^\infty K_s^2 \, d\langle M \rangle_s] = 0$.
Define the process
\begin{align*}
X : [0, \infty) \times \Omega &\to \mathbb{R} \\
t &\mapsto \int_0^t K_s \, d\langle M \rangle_s,
\end{align*}
where the integral is a Lebesgue--Stieltjes integral with respect to the increasing process $t \mapsto \langle M \rangle_t$ (pathwise). Since $K \in L^2(M) \subset L^1(\Omega \times [0,\infty), d\mathbb{P} \otimes d\langle M \rangle)$ (by the Cauchy--Schwarz inequality, $\mathbb{E}[\int_0^t |K_s| \, d\langle M \rangle_s] \leq \|K\|_{L^2(M)} \cdot \mathbb{E}[\langle M \rangle_t]^{1/2} < \infty$ since $M \in \mathcal{M}^2_c$), the process $X$ is well-defined, continuous (since $\langle M \rangle$ is continuous), adapted (since $K$ is previsible and $\langle M \rangle$ is adapted), and of finite variation (with total variation bounded by $\int_0^t |K_s| \, d\langle M \rangle_s$). Moreover, $X_0 = 0$.[/step]