Suppose that $\displaystyle fg \in L^2 ([a,b])$ for all $\displaystyle f \in L^2([a,b])$. How to show that $\displaystyle g$ is also in $\displaystyle L^2([a,b])$
You are given that $\displaystyle fg \in L^2 ([a,b])$ for all $\displaystyle f \in L^2 ([a,b])$. This is known; you don't have to prove this. Therefore, you can replace $\displaystyle f$ with any function, as long as it is in $\displaystyle L^2 ([a,b])$, and still get a true statement. I suggest replacing $\displaystyle f$ with a function that equals 1 everywhere.