If $0$ is not in the spectrum of $A$, then $A$ is invertible with inverse $B$. Since the product of compact operators is compact, the identity $I = AB$ is compact. But this is impossible if $A$ acts on an infinite-dimensional Banach/Hilbert space, because the closed unit ball is not compact.


This is indeed only true in infinite dimensions.

Suppose your compact operator $A$ has finite spectrum. Then there are only finitely many eigenvectors with nonzero eigenvalue. Let $F$ be the subspace spanned by those eigenvectors and let $E$ be its orthogonal complement. Since $F$ is finite dimensional, $E$ is infinite dimensional, and in particular $E \ne 0$. The restriction of $A$ to $E$ is another compact operator. What are its eigenvalues?


Suppose $X$ is a Banach space and suppose that $T : X\rightarrow X$ is linear. Then the following are true:
1. If $X$ is finite-dimensional, then $T$ is compact, regardless of whether or not $0 \in \sigma(T)$.
2. If $X$ is infinite-dimensional and $T$ is compact, then $0 \in \sigma(T)$.