If an element in a Banach algebra is anihilated by an analytic function then it must be algebraic. Let $A$ be a Banach algebra, let $a\in A$ and suppose $f(a)=0$, where $f$ is an analytic function defined on an open set $U$ containing $\sigma(a)$.  Prove that $a$ is algebraic in the sense that $p(a)=0$ for some polynomial $p$.

PS: I have just answered an identical question a few minutes ago but then, almost immediately, the questioner deleted the question and with it my nice answer which I enjoyed very much writing. I am therefore asking it again and I'll soon post my answer here.
Should anyone point me to some Stack Exchange guideline I'm disrespecting by doing so, I'll gladly delete everything again.
 A: As stated this result does not hold.  First of all $f$ could be zero in which case "$f(x)=0$" gives no information
whastoever.  Even if $f$ is nonzero, it still could be zero on the connected component of its domain containing $\sigma (x)$,
and then "$f(x)=0$" again says nothing.
In order to prove the result it is important to assume that $f$ is not identically zero on any connected component of
its domain.
This said, by the Spectral  Mapping Theorem,
$$
  \{0\} = \sigma (f(x)) = f(\sigma (x)),
  $$
which says that $f$ vanishes on the spectrum of $x$.  Because $\sigma (x)$ is compact, and because the set of zeros of an
analytic function satisfying our hypothesis cannot have accumulation points, if follows that $\sigma (x)$ is a finite set.
Writing
$$
  \sigma (x) = \{a_1, a_2, \ldots ,  a_n\},
  $$
for every $i=1,2,\ldots ,n$ we   let $n_i$ be the (finite) order of  $a_i$ as a zero of $f$, so that
$$
  f(z)=g(z)\prod_{i=1}^n(z-a_i)^{n_i},
  $$
for all $z$, where $g$ is some analytic function defined on the domain of  $f$, not vanishing on any $a_i$.
It follows that
$$
  0=f(x)=g(x)\prod_{i=1}^n(x-a_i)^{n_i},
  $$
but since $g(x)$ is invertible (again by the Spectral Mapping Theorem), we must have that
$\prod_{i=1}^n(x-a_i)^{n_i}=0$,  as desired.
