Let $(\Omega,\mathcal A,\mu)$ be a measure space, $p,q\ge1$ with $p^{-1}+q^{-1}=1$ and $f:\Omega\to\mathbb R$ be $\mathcal A$-measurable with $$\int|fg|\:{\rm d}\mu<\infty\;\;\;\text{for all }g\in L^q(\mu)\tag1.$$ By $(1)$, $$L^q(\mu)\ni g\mapsto fg\tag2$$ is a bounded linear fuctional and hence there is a unique $\tilde f\in L^p(\mu)$ with $$(f-\tilde f)g=0\;\;\;\text{for all }g\in L^q(\mu)\tag3.$$
Can we conclude that $f=\tilde f$?
EDIT: As we can see from this answer, we need to impose further assumptions; but which do we really need?