I came across the following problem
Let $1\le p\le q\le\infty$ then show that the canonical injection from $L^q(0,1)$ to $L^p(0,1) $ is continuous but not compact.
The continuity here is straightforward since
by Holder inequality one can easily show that
$$\|u\|_p\le \|u\|_q.$$
How to show that this injection is not compact.
Note this injection is weakly compact as well see here: Canonical inclusion $L^q(0,1) \to L^p(0,1)$ is compact?
Let us fix $q\le p$ and consider the sequence $f_n(x)=\sin(\pi n x)$. We have that $f_n$ is bounded in the $L^p$ norm, but it has no subsequences that converge strongly in the $L^q$ norm. In fact such a subsequence would converge to the function $0$ (because $f_n$ weakly converges to $0$ in $L^r$ for all $r<+\infty$ and weakly-star in $L^\infty$), but an explicit calculation gives $$\exists\delta=\delta(q):\quad\|f_n\|_{L^q}\ge \delta>0$$ for all $n$. So this is a counterexample to the definition of compact injection.