Set of all Self-Maps under Composition forms Monoid

Theorem
The set $S^S$ of all mappings from a set $S$ to itself forms a monoid in which the operation is composition of mappings.

Proof

 * A mapping followed by another mapping is another mapping, from the definition of composition of mappings.

As the domain and codomain of two mappings are the same for a mapping $f: S \to S$, then the composite is defined.

Therefore composition of mappings on a set is closed.


 * Composition of relations is associative, and therefore so is composition of mappings.


 * The identity mapping is the identity element of this set of mappings.


 * It's closed and associative, so it's a semigroup.

It has an identity element, so it's a monoid.