Is there an idempotent element in a finite semigroup?

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$.


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}$.


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.)