Solution (source code)

= Solution

\b[No.] Choose a nonzero $\varphi\in C_c^\infty(\mathbb R)$ and a number $L$ larger than the diameter of its support, and set
$$
u_n(x)=\varphi(x-nL).
$$
Translation preserves both the $L^2$ norm and the derivative norm, so $(u_n)$ is bounded in $H^1(\mathbb R)$. Distinct $u_n$ have disjoint supports, and hence
$$
\|u_n-u_m\|_2^2
=\|u_n\|_2^2+\|u_m\|_2^2
=2\|\varphi\|_2^2
\qquad(n\ne m).
$$
\b[Thus the sequence has no $L^2$-Cauchy subsequence and therefore no strongly convergent subsequence. The embedding $H^1(\mathbb R)\hookrightarrow L^2(\mathbb R)$ is not compact.]