I'm styding harmonic analysis and the book i'm reading takes for a fact that
$$\int_{-\pi}^{\pi} \| f(x)-g(x)\|^2dx \leq 2\sup\limits_{x \in [-\pi, \pi]}f(x) \int_{-\pi}^{\pi} \| f(x)-g(x)\|dx$$ And if $\sup\limits_{x \in [-\pi, \pi]}f(x)=\|f\|_{\infty}$. Then the above inequality is: $$\int_{-\pi}^{\pi} \| f(x)-g(x)\|^2dx \leq 2\|f(x)\|_{\infty} \int_{-\pi}^{\pi} \| f(x)-g(x)\|dx$$
Where $f,g : [-\pi, \pi] \rightarrow \mathbb{R}$ are continuous and $2\pi$-periodic functions and $\|g\| \leq \|f\|_{\infty} \quad \forall x \in [-\pi, \pi]$.
My attempt:
$$\int_{-\pi}^{\pi} \| f(x)-g(x)\|^2dx = \int_{-\pi}^{\pi} ( f(x)-g(x))^2dx=\int_{-\pi}^{\pi} (f^2(x)+g^2(x)-2f(x)g(x))dx \leq \int_{-\pi}^{\pi} (f^2(x)+g^2(x)-2\|f(x)\|_{\infty}^2)dx$$ And that's about it.