Skip to main content
Logo image

Section 7.5 Identity Functions

For every set \(A\text{,}\) there is a special function that maps each element to itself. Because the image of each element is the same element, this function is called the identity function.

Definition 7.5.1.

For any set \(A\text{,}\) the function \(\id_A:A\to A\) given by \(\id_A(b)=b\) for all \(b \in A\) is the identity function on \(A\text{.}\)
In the video in Figure 7.5.2 we introduce identity functions and give examples.
Figure 7.5.2. Identity Functions by Matt Farmer and Stephen Steward

Example 7.5.3. Identity function on \(\Z_3\).

The identity function on \(\Z_3=\{0,1,2\}\) is the function \(\id_{\Z_3}:\Z_3\to\Z_3\) given by:
\begin{align*} \id_{\Z_3}(0)\amp=0\\ \id_{\Z_3}(1)\amp=1\\ \id_{\Z_3}(2)\amp=2 \end{align*}
The next theorem describes how the identity function works with composition.

Proof.

Let \(A\) and \(B\) be sets, and let \(f:A\to B\) be a function. Let \(a\in A\text{.}\) Then,
\begin{equation*} (f\circ \id_A)(a)=f(\id_A(a))=f(a)\text{,} \end{equation*}
implying that \(f\circ \id_A=f\text{.}\) Also, \(\id_B(b)=b\) for all \(b\in B\text{.}\) So in particular,
\begin{equation*} (\id_B\circ f)(a)=\id_B(f(a))=f(a)\text{,} \end{equation*}
implying that \(\id_B\circ f=f\text{.}\)
Now complete the definition of the identity function on a set and the statement of the theorem.
To decide whether a function \(f\) is the identity function, evaluate it at every element of its domain. It is the identity function when \(f(a)=a\) for every element \(a\) in its domain.

Problem 7.5.5. Is \(f:\Z_5\to\Z_5\text{,}\) \(f(x)=(x^5)\fmod 5\) the identity.

Decide whether the function \(f:\Z_5\to\Z_5\) given by \(f(x)=(x^5)\fmod 5\) is the identity function on \(\Z_5\text{.}\)
Solution.
We evaluate the function \(f\) at all elements of its domain \(\Z_5=\{0,1,2,3,4\}\text{.}\) If \(f(x)=x\) for all \(x\in\Z_5\) then \(f\) is the identity function on \(\Z_5\text{.}\)
\begin{align*} f(0)\amp =(0^5)\fmod 5 = 0\fmod 5= 0\\ f(1)\amp =(1^5)\fmod 5 = 1\fmod 5= 1\\ f(2)\amp =(2^5)\fmod 5 = 32\fmod 5=2\\ f(3)\amp =(3^5)\fmod 5 = 243\fmod 3= 3\\ f(4)\amp =(4^5)\fmod 5 = 1024\fmod 5= 4 \end{align*}
As \(f(x)=x\) for all \(x\in\Z_5\) it is the identity function on \(\Z_5\text{.}\)

Problem 7.5.6. Is \(f:\Z_4\to\Z_4\text{,}\) \(f(x)=(x^2)\fmod 4\) the identity.

Decide whether the function \(f:\Z_4\to\Z_4\) given by \(f(x)=(x^2)\fmod 4\) is the identity function on \(\Z_4\text{.}\)
Solution.
We evaluate the function \(f\) at all elements of its domain \(\Z_4=\{0,1,2,3\}\text{.}\) If \(f(x)=x\) for all \(x\in\Z_4\) then \(f\) is the identity function on \(\Z_4\text{.}\)
\begin{align*} f(0)\amp =(0^2)\fmod 4 = 0\fmod 4= 0\\ f(1)\amp =(1^2)\fmod 4 = 1\fmod 4= 1\\ f(2)\amp =(2^2)\fmod 4 = 4\fmod 4= 0 \end{align*}
We have found that \(f(2)=0\ne 2\text{.}\) So \(f\) is not the identity function on \(\Z_4\text{.}\)
In Example 7.5.7 we consider the composite of two functions and find that it is an identity function.

Example 7.5.7. A composite that is the identity.

Consider the two functions
\begin{equation*} f:\Z_5\to \Z_5\text{ given by }f(x)=3\cdot x \end{equation*}
and
\begin{equation*} g:\Z_5\to \Z_5\text{ given by }g(x)=2\cdot x. \end{equation*}
Then \((g\circ f)\) is a function with domain \(\Z_5\) and codomain \(\Z_5\text{.}\) We show that \((g\circ f)\) is the identity function on \(\Z_5\text{.}\)
Since \(\Z_5=\{0,1,2,3,4\}\) has only a few elements, we can check every element of \(\Z_5\text{.}\) We get
\(x\) \(f(x)\) \(g(f(x))\)
\(\mathbf{0}\) \(f(0)=(3\cdot 0)\fmod 5=0\) \(g(f(0))=(2\cdot f(0))\fmod 5=\mathbf{0}\)
\(\mathbf{1}\) \(f(1)=(3\cdot 1)\fmod 5 =3\) \(g(f(1))=(2\cdot f(1))\fmod 5=(2\cdot 3)\mod 5 = \mathbf{1}\)
\(\mathbf{2}\) \(f(2)=(3\cdot 2)\fmod 5 = 1\) \(g(f(2))=(2\cdot f(2))\fmod 5= 2\fmod 5 = \mathbf{2}\)
\(\mathbf{3}\) \(f(3)=(3\cdot 3)\fmod 5 =4\) \(g(f(3))=(2\cdot f(3))\fmod 5=(2\cdot 4)\mod 5=\mathbf{3}\)
\(\mathbf{4}\) \(f(4)=(3\cdot 4)\fmod 5 =2\) \(g(f(4))=(2\cdot f(4))\fmod 5=(2\cdot 2)\mod 5=\mathbf{4}\)
We see that in each row of the table the columns for \(x\) and for \(g(f(x))\) have the same entries, that is \(g(f(x))=x\) for all \(x\in\Z_5\text{.}\) So \((g\circ f)=\id_{\Z_5}\text{.}\)
Even the composite of a function with itself can be the identity function.

Example 7.5.8. A function that composed with itself is the identity.

Consider the function
\begin{equation*} f:\Z\to \Z\text{ given by }f(x)=(-x). \end{equation*}
We show that \((f\circ f)\) is the identity function on \(\Z\text{.}\)
Clearly both the domain and codomain of \((f\circ f)\) are the set of integers \(\Z\text{.}\) Let \(x\in\Z\text{.}\) We have
\begin{equation*} (f\circ f)(x)=f(f(x))=f(-x)=-(-x)=x. \end{equation*}
So, by Definition 7.5.1, the composite \((f\circ f)\) is the identity function on \(\Z\text{.}\)