It is easy to check that $T^*Te_n=|a_n|^2\,e_n$ for all $n$. So $|T|\,e_n=|a_n|\,e_n$ for all $n$. Now, if $T=|T|\,U$, then
$$
\langle Te_j,e_k\rangle=\langle |T|Ue_j,e_k\rangle=\langle Ue_j,|T|e_k\rangle=|a_k|\,\langle Ue_j,e_k\rangle.
$$
This shows that $U$ is the operator $Ue_n=\frac1{|a_n|}\,Te_n=\arg(a_n)\,e_{n+1}$.
As $T$ is compact if and only if $|T|$ is, the fact that $|T|$ is diagona and $a_1,a_2,\ldots$ are its eigenvalues imply that $T$ is compact if and only if $a_n\to0$.
As for Fredholm, if $a_n\to0$, then $T$ is compact so it cannot be Fredholm. If $a_n$ does not converge to zero, then the sequence is eventually bounded away from zero. This allows one to mimic what happens in the case of the shift (i.e. when $a_n=1$ for all $n$) to conclude that there exists $S$ such that $TS-I$ and $ST-I$ are compact. In conclusion $T$ is Fredholm precisely when it is not compact, i.e. when $a_n$ does not converge to zero.