I am trying to solve the following problem:
Let $f:[0,1] \to \mathbb{C}$ be a continuous function and $T_f:L^2[0,1] \to L^2[0,1]$ be the operator given by $T_f(g)=fg, \; g \in L^2[0,1].$ Prove that $T_f$ is a bounded linear operator on $L^2[0,1]$ and that $T_f$ is compact iff $f=0$.
Now, the linearity of $T_f$ follows by linearity of the usual operations. Indeed $$ T_f(\alpha g_1 + g_2)= f(\alpha g_1 + g_2)= \alpha fg_1 + fg_2= \alpha T_f g_1 + T_f g_2. $$ For boundedness, we have that \begin{align*} \|T_f\|^2_{L^2[0,1]} = \int_{0}^{1} |f|^2|g|^2 &\leq \int_{0}^{1} |f|^2 \quad (\|g\|\leq 1) \\ &\leq \|f\|^2_{L^2[0,1]}. \end{align*}
Then if $f=0$ clearly $T_f$ is compact (being the range just $\{0\}$), but I am having trubles showing that if $f\neq 0$ then $T_f$ is not compact. Any help is appreciated.