Sub topic 7
The Identity Function as the Do-Nothing Function
This chapter assumes that you know function notation, domains and ranges, and basic composition. You should be comfortable reading expressions such as \((f \circ g)(x)\).
What is the identity function?
The identity function is a function that returns its input unchanged. On a set \(A\), it is written \(I_A\) and defined by
\[ I_A(x)=x \]
for every \(x\) in \(A\).
For real numbers, we often write simply
\[ I(x)=x. \]
The identity function does not change a value. If the input is \(7\), the output is \(7\). If the input is \(-3\), the output is \(-3\).
| Input \(x\) | Identity output \(I(x)\) |
|---|---|
| \(-2\) | \(-2\) |
| \(0\) | \(0\) |
| \(5\) | \(5\) |
Its graph is the line \(y=x\). Every point on the graph has equal coordinates.
Identity and composition
Composition means feeding the output of one function into another. The identity function acts as a neutral element for composition.
For any function \(f\) whose domain and range are compatible,
\[ (f \circ I)(x)=f(I(x))=f(x) \]
and
\[ (I \circ f)(x)=I(f(x))=f(x). \]
The first equation says that applying the identity before \(f\) changes nothing. The second says that applying it after \(f\) also changes nothing.
def f(x):
return 2 * x + 3
def identity(x):
return x
print(f(identity(4))) # 11
print(identity(f(4))) # 11
print(f(4)) # 11These equalities require compatible domains and ranges. For example, if \(f\) accepts only positive inputs, then \(I\) must be used on values in that domain when evaluating \(f \circ I\).
Identity and inverse functions
The identity function appears in the definition of an inverse. A function \(f\) and a function \(f^{-1}\) are inverses when both compositions produce the appropriate identity function:
\[ f^{-1}\circ f=I_{\text{domain of }f} \]
and
\[ f\circ f^{-1}=I_{\text{range of }f}. \]
For example, let
\[ f(x)=2x+3 \]
and
\[ f^{-1}(x)=\frac{x-3}{2}. \]
Then
\[ f^{-1}(f(x)) =\frac{(2x+3)-3}{2} =x, \]
so the result is the identity on the domain of \(f\). In the other direction,
\[ f(f^{-1}(x)) =2\left(\frac{x-3}{2}\right)+3 =x. \]
Both compositions return their inputs.
The subscripts matter when the functions use different sets. The identity on the original inputs and the identity on the outputs may be functions on different sets, even though both use the rule “return the input.”
A useful way to recognize identity
When simplifying a composition, look for a complete cancellation that leaves the original variable. For example,
\[ \frac{(2x+3)-3}{2}=x. \]
That final \(x\) is evidence that the composition behaves as an identity function. It is also the main algebraic test for verifying an inverse.
Exercise
If f(x) = x - 8 and I(x) = x, simplify (f ∘ I)(x) and (I ∘ f)(x).
Show answer
Both compositions equal x - 8. Specifically, f(I(x)) = f(x) = x - 8, and I(f(x)) = f(x) = x - 8.