The identity element of a semigroup (S,•) is an element e in the set S such that for all elements a in S, e•a = a•e = a. Such a semigroup is also a monoid.
Examples
 Identity function, which serves as the identity element of the set of functions whose domains and codomains are of a given set, with respect to the operation of function composition.
 Identity matrix, a square matrix that serves as the identity element of the set of square matrices of a particular dimension, with respect to matrix multiplication.
 0 and 1, the identities in the set of real numbers and some of its subsets, with respect to addition and multiplication, respectively.
Uniqueness of the identity element
An important fact in mathematics is that whenever a binary operation on a set has an identity, the identity is unique; no other element as the set serves as the identity. This ensures that zero and one are unique within the number system. We can refer to the identity of a set as opposed to an identity of a set.
Theorem. (Uniqueness of an identity element) Let (S,·) be a semigroup. If there exists an identity element with respect to ·, then that identity element is unique. 

Proof. (By contradiction) Suppose $ e $ and $ f $ are distinct identity elements with respect to ·. Since $ e $ is an identity element, $ f\cdot e=f $, and since $ f $ is also an identity element, $ f \cdot e =e $. Thus, $ e $ must be equal to $ f $, so $ e $ and $ f $ cannot be distinct. We have a contradiction, therefore the identity element must be unique.
