Let's assume we're working on a measure space $(X,\Sigma,\mu)$, where $\mu$ is a $\sigma$-finite measure. Suppose that $g$ is a measurable function such that $\forall f\in L^2$, $||fg||_2\leq ||f||_2$. Now, show that $g\in L^\infty$ and find $||g||_\infty$.
First thing I tried was to do it by contradiction (i.e. assume that $\forall M\in\mathbb{R}^+$, $\mu\Big(\{x\in X: g(x)>M\}\Big)>0$), and tried to play with some inequalities, but didn't get anywhere. Also tried setting $M>||f||_2$, and dealing with the two sets $E_M:=\{x\in X: g(x)>M\}$ and $X\setminus E_M$ in that case, but couldn't do it. I was aiming to show that that would lead to $||fg||_2>||f||_2$.
It seems like a question that would use one of the common inequalities (likely Hölder's, but Minkowski's or Young's too), I just couldn't put it together.
Any ideas?