An identity function on a set AA is the idA:A→A\mathrm{id}_A:A\to A defined by

idA(a)=afor all a∈A.\mathrm{id}_A(a)=a\quad\text{for all }a\in A.
Remarks

Identity functions are neutral elements for : if f:A→Bf:A\to B is any function, then f∘idA=ff\circ \mathrm{id}_A=f and idB∘f=f\mathrm{id}_B\circ f=f. The identity function is always , and its is itself.

Examples
  • On , idR(x)=x\mathrm{id}_{\mathbb{R}}(x)=x for all x∈Rx\in\mathbb{R}.
  • On the P(A)\mathcal{P}(A) of a set AA, the identity function sends each subset S⊆AS\subseteq A to itself.