I have to choose whether the following operator
$$f\in L^2(\mathbb{R})\mapsto\int_{\mathbb{R}}f(x) e^{-x^2} dx$$
is a compact operator. I have tried to use the Cauchy Schwarz inequality
$$\langle f, e^{-x^2}\rangle \leq \|f\|_{L^2} \cdot \underbrace{\|e^{-x^2}\|_{L^2}}_{\leq\pi} \leq\pi\cdot\|f\|_{L^2} $$
but how can I identify the compactness of an operator?
$T:X\to Y$ is compact if it sends bounded sets to relatively compact sets. Your operator $T:L^2\to\mathbb R$ sends bounded sets to bounded sets (because of Cauchy-Schwarz), but bounded sets in $\mathbb R$ are relatively compact, so the operator is compact.