Composition of Commuting Idempotent Mappings is Idempotent

Theorem
Let $S$ be a set.

Let $f, g: S \to S$ be idempotent mappings from $S$ to $S$.

Suppose that $f \circ g = g \circ f$, where $\circ$ denotes composition.

Then $f \circ g$ is idempotent.

Proof 2
By Set of All Self-Maps is Semigroup, the set of all mappings from $S$ to $S$ forms a semigroup under composition.

Thus the result follows from Product of Commuting Idempotent Elements is Idempotent.