Let $(X,\mathscr{E},\mu)$ be a measure space, $p\in(1,\infty)$, $q=\frac{p}{p-1}$ and $S\subset L^q$ be a dense subset. Then
$$f\in L^p \text{ and } \int_Xfgd\mu=0 \text{ } \forall g\in S => f=0 \text{ }\mu\text{-almost-everywhere}$$
I'm not sure whether my proof is correct and I haven't found anything on the internet yet that solves this question. So I would appreciate really much if anyone could give me some feedback for my proof:
Assume $f\neq0$ a.e. then $\exists E\subset X$ such that $ \mu(E)\neq0$ and $f\neq0$ on $E$.
Now here's the part that might be wrong: I can choose $E$ such that $\mu(E)<\infty$.
Then $\unicode{x1D7D9}_E\in L^q$ and since S is dense, we can approximate $\unicode{x1D7D9}_E$ by a growing sequence $g_n \in S$. Then $\lim\limits_{n \to \infty} \int_Xfgd\mu=\int_Xf\unicode{x1D7D9}_Ed\mu\neq0$.
The only potential problem with choosing $E$ so $0 < \mu(E) < \infty$ is that there are positive measures $\mu$ with sets $E$ such that $\mu(E) = \infty$ and no measurable subset of $E$ has nonzero finite measure. But that can't happen here, because $f \in L^p$ and $f \ne 0$ on $E$. Consider sets of the form $\{x: f(x) > \epsilon\}$ (or $< - \epsilon$).