Is there an idempotent element in a finite semigroup? Let $(G,\cdot)$ be a non-empty finite semigroup. Is there any $a\in G$ such that:
$$a^2=a$$
It seems to be true in view of theorem 2.2.1 page 97 of this book (I'm not sure).  But is there an elementary proof?

Theorem 2.2.1. [R. Ellis] Let $S$ be a compact right topological semigroup. Then there exists an idempotent in it.

This theorem is also known as Ellis–Numakura lemma.
 A: When I first saw the question, I remembered there was a proof on MO using Ramsey theory, but couldn't remember how the argument went, so I came up with the following, that I first posted as a comment:

A cute proof using Schur's theorem: Fix $a$ in your semigroup $S$, and color $n$ and $m$ with the same color whenever $a^n=a^m$. By Schur's theorem (and the fact that the semigroup is finite) there are $n\le m$ such that $n$, $m$, and $n+m$ have the same color. That is, $a^n=a^m=a^{n+m}=(a^n)^2$.

(Today I finally found the thread on MO with the Ramsey theory proof, using Ramsey's theorem directly rather than Schur's theorem.)
A: You can find a proof $^1$ of the following theorem, from which your assertion follows, at Proof Wiki
Finite Semigroup: Exists Idempotent Power

Theorem
Let $(S,\circ)$ be a finite semigroup.
For every element in $(S,\circ),$ there is a power of that element which is idempotent.
That is: $$\forall x \in S:\exists i \in \mathbb N:x^i=x^i\circ x^i$$

Essentially, then, for your purposes: you can simply set $a = x^i$, and you have the existence of an idempotent element $a \in S$ such that $\;a^2 = a$.
$1.$ Source of proof: Thomas A. Whitelaw: An Introduction to Abstract Algebra (1978).
A: Note first that it suffices to prove that $a^k = a$ for some $k \geq 2$. If $k = 2$ we are done. Otherwise $k > 2$ and multiplying both sides by $a^{k-2}$ gives $(a^{k-1})^2 = a^{k-1}$.
Fix $x \in G$ and consider the sequence 
$$x, x^2, x^4, x^8, x^{16}, \ldots$$
Since $G$ is finite, there is repetition in this sequence. That is, $x^{2^t} = x^{2^s}$ for some integers $t > s \geq 1$. Thus $x^{2^t} = (x^{2^s})^{2^{t-s}} = x^{2^s}$, so choosing $a = x^{2^{s}}$ and $k = 2^{t-s}$ gives $a^k = a$. Note that $k \geq 2$ since $t > s$.
A: This is a very good point proved by E.H.Moore that says:

Some power of every element of a finite semigroup is idempotent.

Trans. Amer. Math. Soc. 3 1902
A: Let $x$ be an element of $S$. Since $S$ is finite, there exist integers $i, p >0$ such that $x^i = x^{i+p}$. It follows that, for all $k \geqslant i$, $x^k = x^{k+p}$. In particular, if $k$ is a multiple of $p$, say $k = qp$, one has
$(x^k)^2 = x^{2k} = x^{k+qp} = x^k$ and thus $x^k$ is idempotent.
A: Pick an arbitrary element and start iterating $x\mapsto x^2$. Since the semigroup is finite you will eventually hit a cycle. This gives you a $b$ such that $b^k=b$ for some $k\ge 2$. Now set $a=b^{k-1}$.
A: This is essentially the J.-E. Pin's argument. Let $x$ be in your semigroup. There are positive integers $i,j$ such that $x^{i+j}=x^i$. We have $x^{i+jk}=x^i$ for all positive integer $k$ (induction on $k$). Choosing $k$ so that $jk>i$ we get
$$
(x^{jk})^2=x^{jk-i}\,x^{i+jk}=x^{jk-i}\,x^i=x^{jk}.
$$
