Let $g \in L^{\infty}(\mathbb R)$. Consider the operator $ \begin{split} T_g\colon & L^2(\mathbb R)\to L^2(\mathbb R) \\ & f \mapsto gf \end{split} $ Prove that $T_g$ is compact (i.e., the image under $T_g$ of bounded closed sets is compact) if and only if $g=0$ a.e.
I do not know how to start and I'm very puzzled. I know very little about compactness in $L^p$: of course they are complete metric spaces, therefore a subspace is compact if and only if it is closed (complete) and totally bounded. A singleton is of course totally bounded and I think it is closed: therefore I can say that if $g=0$ a.e. then the image of every subspace is $\{0\}$ which is compact, so the operator is compact. What about the inverse direction? It seems hard to prove. Would you help me, please? Thanks.