Criterion for compactness Let $T:H\to H$ be a continuous operator on a Hilbert space.
Assume there exists an orthonormal base $(e_j)_{j\in\mathbb N}$, such that the sequence $Te_j$ tends to zero.
Must $T$ be compact?
 A: This is another example. Consider the Hardy operator in $L^2(0,1)$, $$Hf(x)=\frac{1}{x}\int_0^x f(t)\, dt,$$ which is bounded by Hardy inequality. If $f_n=\sqrt{n} \chi_{[0,1/n]}$, then $\|f_n\|_2=1$ and $f_n\to 0$ weakly but $\|Hf_n\|_2 \geq 1$ so that $H$ is not compact. If $g_n(x)=\sin (n\pi x)$, then $(g_n)$ is an orthonormal basis but $Hg_n(x)=\frac{2 \sin^2 (n\frac{\pi}{2} x)}{n\pi x}$ and $$\|Hg_n\|_2^2=\frac{4}{\pi^2 n}\int_0^n \frac{\sin^4 \frac{\pi}{2}y}{y^2} \approx \frac{C}{n}.$$
In some sense this example is optimal: if $\sum_n \|T e_n\|_2^2 <\infty$ for some orthonormal basis, then $T$ is Hilbert Schmidt, hence compact.
One can produce also self-adjoint examples: just use the polar decomposition $H=U|H|$ and $\||H|f\|_2=\|Hf\|_2$. However, I do not know what happens with orthogonal projections.
A: We probably don't need another answer, but here it is anyway, especially since Giorgio raised the question about projections.
Lemma: There is an ONB $\{ v_j\}$ of $\mathbb C^n$ such that $|\langle e_1, v_j\rangle |= n^{-1/2}$ for all $j=1,2, \ldots , n$.
Proof: This is trivial: it works if we replace $e_1$ by $w=(n^{-1/2}, \ldots, n^{-1/2})$ and use the standard ONB. Now apply a unitary map that moves $w$ to $e_1$ to everything.
It follows that any projection $P$ on a separable space $H$ with $\dim N(P)=\dim R(P)=\infty$ is a non-compact bounded operator with $Pe_j\to 0$ on a suitable ONB. We can build such an ONB by applying the lemma to reducing subspaces spanned by $n$ orthogonal vectors, with one of them taken from $R(P)$ and the others from $N(P)$ and $n$ becoming larger as we move along.
A: $T$ is not necessarily compact. Let me produce a counterexample.
Let $H$ be any infinite dimensional real or complex separable Hilbert space. Let $(f_{j,k})_{1\leq k\leq j},(e_{j})_{j=1}^{\infty}$ be orthonormal bases for $H$.
Then let $T:H\rightarrow H$ be the bounded linear operator defined by letting
$T(f_{j,k})=\frac{1}{\sqrt{j}}\cdot e_{j}$ whenever $1\leq k\leq j$. We observe that $T(f_{j,k})\rightarrow 0$ as $j\rightarrow\infty$.
We observe that $$\biggl\|\sum_{j=1}^{\infty}\sum_{k=1}^{j}a_{j,k}f_{j,k}\biggr\|^{2}=\sum_{j=1}^{\infty}\sum_{k=1}^{j}a_{j,k}^{2}
=\sum_{j=1}^{\infty}\sum_{k=1}^{j}a_{j,k}^{2}
\geq\sum_{j=1}^{\infty}\frac{1}{j}\biggl(\sum_{k=1}^{j}a_{j,k}\biggr)^{2}$$
$$=
\sum_{j=1}^{\infty}\biggl(\frac{1}{\sqrt{j}}\sum_{k=1}^{j}a_{j,k}\biggr)^{2}
=\biggl\|\sum_{j=1}^{\infty}\biggl(\frac{1}{\sqrt{j}}\sum_{k=1}^{j}a_{j,k}\biggr)e_{j}\biggr\|^{2}=\biggl\|T\biggl(\sum_{j=1}^{\infty}\sum_{k=1}^{j}a_{j,k}f_{j,k}\biggr)\biggr\|^2.$$
Therefore, $T:H\rightarrow H$ is a bounded linear operator with norm $1$.
However, if $y\in H$, then $y=\sum_{j}a_{j}e_{j}$, then let
$x=\sum_{j=1}^{\infty}\sum_{k=1}^{j}\frac{1}{\sqrt{j}}\cdot a_{j}f_{j,k}$.
Then $$\|x\|^{2}=\sum_{j=1}^{\infty}\sum_{k=1}^{j}(\frac{1}{\sqrt{j}}\cdot a_{j})^{2}=\sum_{j=1}^{\infty}\sum_{k=1}^{j}\frac{1}{j}a_{j}^{2}=\sum_{j=1}^{\infty}a_{j}^{2}=\|y\|^{2}.$$
However, $$T(x)=\sum_{1\leq k\leq j}\frac{1}{j}a_{j}e_{j}=\sum_{j=1}^{\infty}a_{j}e_{k}.$$
Therefore, $T$ cannot be compact since $T$ maps the unit ball of $H$ surjectively onto the unit ball of $H$.
In fact, $T$ maps the orthonormal set $(\frac{1}{\sqrt{j}}\sum_{k=1}^{j}f_{j,k})_{j=1}^{\infty}$ to the orthonormal basis $(e_{j})_{j=1}^{\infty}$.
