How can you conclude that if $\int_X^{2X}\lvert f-g\rvert^2=O(X)$ then $\lvert f-g\rvert=O(1)$ for $X\le x\le 2X$ and $X\in\mathbb R$ and large enough.
Does this follow from Cauchy-Schwartz ?
Then the conclusion is automatically valid if we drop the square ?