Let $H$ be a dense subspace of $L^2(X,\mu)$ ($X$ being a separable and complete metric space with finite measure $\mu$) and $(f_n)_{n\in\mathbb N}$ be a sequence in $H$ that converges to $f\in L^2(X,\mu)$ in the following sense: $$ \langle f_n - f, h \rangle_{L^2} \xrightarrow{n\to\infty} 0 \quad \text{for all } h\in H. $$ In addition, let $f_n$ converge pointwise $\mu$-almost everywhere to some function $g$, i.e. $f_n(x)\xrightarrow{n\to\infty} g(x)$ for $\mu$-almost every $x\in X$.
I need to show that $f$ and $g$ agree $\mu$-almost everywhere, in other words $f_n(x)\xrightarrow{n\to\infty} f(x)$ pointwise for $\mu$-almost every $x\in X$.
I have been struggling to prove this (and also to find counterexamples), but so far I cannot find the right analytical tools. Any help will be very appreciated!
Remark: I know very little about the $f_n$, there may be no upper bound on their norm etc.
Remark: The background is that I am trying to prove a convergence result for conditional mean embeddings in reproducing kernel Hilbert spaces (this is not an homework exercise).
This should be a counterexample. Consider $L^2(0,1)$ with the usual Lebesgue measure. Fix $$ H = \{f \in L^2(0,1) \;\mid\; \exists t > 0 : f_{|(0,t)} = \frac1{1-t}\int_t^1 f \, \mathrm dx \}.$$ I think that this subspace is dense (modify $v \in L^2(0,1)$ on a small interval $(0,t)$ to obey the condition). Note that $$\int_0^1 h \, \mathrm{d}x = t \, h_{|(0,t)} + \int_t^1 h \, \mathrm dx = h_{|(0,t)}$$ for all $h \in H$ and $t$ chosen according to the definition of $H$. Next, we fix $f_n = n \, \chi_{(0,1/n)}$. For $h \in H$ we have $$(f_n, h) = n \, \int_0^{1/n} h \, \mathrm{d}x = h_{|(0,t)} = \int_0^1 h \, \mathrm dx = (1,h),$$ where $1 \in L^2(0,1)$ is the constant function. Moreover, $f_n \to 0$ a.e.
This shows that the weak limit $1$ is not equal to the pointwise limit $0$.