Identity Function — Definition, Graph, Properties, and Examples

#Algebra
TL;DR
An identity function returns whatever you put in, unchanged — its rule is $f(x) = x$. This article defines the identity function, draws its graph as the straight line $y = x$ through the origin, lists its key properties (it is its own inverse, bijective, slope $1$), and works through six examples — including how it differs from a constant function.
BT
Bhanzu TeamLast updated on June 29, 20268 min read

What Is an Identity Function?

An identity function is a function that always returns its input unchanged. For every element $x$ in its domain, the output equals the input:

$$f(x) = x$$

It is sometimes written $I(x)$ or $\text{id}(x)$. Whatever value enters, the same value leaves — there is no scaling, no shift, no transformation. Because the output mirrors the input exactly, the domain and range are identical.

Symbol

Meaning

$f(x)$ or $I(x)$

the identity function

$x$

the input value (and, here, the output too)

$y = x$

the equation of its graph

What Does the Graph of an Identity Function Look Like?

The graph of $f(x) = x$ is a straight line through the origin that makes a $45°$ angle with both axes. Its slope is always exactly $1$, because output rises one unit for every one unit the input rises.

This line, $y = x$, is also the mirror used when graphing any inverse relation — reflecting a graph across it produces the inverse. The identity function and that mirror line are the same object, which is no coincidence: the identity is its own inverse.

What Are the Properties of an Identity Function?

The identity function carries a tidy set of properties that make it the "neutral element" of function composition.

  • Domain equals range. Every output is its own input, so both sets are the same.

  • Slope is $1$. The graph rises at a constant $45°$.

  • It is bijective. It is both one-to-one (no two inputs share an output) and onto (every value in the range is hit).

  • It is its own inverse. Applying it, then applying it again, returns the start: $f(f(x)) = x$. So $f^{-1} = f$.

  • It is the identity for composition. For any function $g$, composing with the identity changes nothing: $g \circ I = g$ and $I \circ g = g$, the same role $0$ plays in addition and the identity matrix plays in matrix multiplication.

Examples of Identity Function

Six examples, from a single evaluation to composition and a domain over a finite set.

Example 1

Evaluate the identity function $f(x) = x$ at $x = 9$.

The identity function returns its input.

$f(9) = 9$

Final answer: $9$.

Example 2

A student claims $f(x) = 1$ is the identity function "because it never changes anything." Is that right?

Wrong attempt. The student reasons that "identity" means "stays the same," and $f(x) = 1$ always gives $1$, so it "stays the same."

Why it breaks. Test an input. $f(2)$ should equal $2$ for an identity function, but $f(2) = 1 \neq 2$. The output did not match the input — so the value did change.

Correct. $f(x) = 1$ is a constant function, not an identity function. The identity returns the input unchanged ($f(2) = 2$); a constant returns the same output regardless of input.

Final answer: $f(x) = 1$ is constant; the identity function is $f(x) = x$.

Example 3

Show that the identity function is its own inverse.

Apply $f$ twice.

$f(f(x)) = f(x) = x$

The composition returns the original input, so $f^{-1}(x) = x = f(x)$.

Final answer: $f^{-1} = f$, so the identity function is self-inverse.

Example 4

Let $g(x) = 3x - 4$. Compute $g \circ I$ and $I \circ g$, where $I(x) = x$.

$I \circ g$ means apply $g$, then $I$: $I(g(x)) = I(3x - 4) = 3x - 4$.

$g \circ I$ means apply $I$, then $g$: $g(I(x)) = g(x) = 3x - 4$.

Final answer: both equal $3x - 4$, so composing with the identity leaves $g$ unchanged.

Example 5

Find the range of the identity function on the domain ${-2, 0, 5, 11}$.

Each element maps to itself.

$f(-2) = -2,\ f(0) = 0,\ f(5) = 5,\ f(11) = 11$

Final answer: range $= {-2, 0, 5, 11}$, identical to the domain.

Example 6

A point sits at $(6, 6)$ on a graph. A second point sits at $(6, 2)$. Which lies on the identity function, and why?

On the identity function, output equals input, so a point $(a, b)$ lies on it only when $a = b$.

$(6, 6)$: here $a = b$, so it lies on $y = x$.

$(6, 2)$: here $6 \neq 2$, so it does not.

Final answer: $(6, 6)$ lies on the identity function; $(6, 2)$ does not.

Why the Identity Function Matters

"Every operation needs an element that changes nothing."

The identity function exists for the same reason $0$ and $1$ do — every system of combination needs a neutral element, and composition is no exception.

  • The neutral element of composition. Just as $a + 0 = a$ and $a \times 1 = a$, composing any function with the identity leaves it untouched. That is what lets us define inverses cleanly: $f \circ f^{-1} = I$.

  • The baseline for transformations. In graphics and geometry, the identity transformation is the "no movement" starting point that every rotation, scaling, and translation is measured against.

  • A reference line. The line $y = x$ is the mirror for inverse functions and the diagonal against which symmetry is judged across the types of functions.

The destination is composition and inverses: once you see the identity as "the function that does nothing," $f \circ f^{-1} = I$ reads as plainly as $a - a = 0$.

Tripping Points to Avoid

Mistake 1: Confusing the identity function with a constant function

Where it slips in: Reading the word "identity" as "unchanging output," as in Example 2.

Don't do this: Treat $f(x) = c$ as an identity function because the output looks fixed.

The correct way: The identity returns the input ($f(x) = x$, a diagonal line); a constant returns a fixed output ($f(x) = c$, a horizontal line). Test one value — they disagree immediately.

The first instinct on the word "identity" is to picture something that stays constant, and that is exactly the slip — the identity keeps the input, not a single output value.

Mistake 2: Thinking the identity function has slope $0$

Where it slips in: Sketching the graph from memory.

Don't do this: Draw a flat horizontal line.

The correct way: The identity function has slope $1$, a $45°$ diagonal through the origin. Slope $0$ belongs to a constant function. The second-guesser who draws it flat is mixing the two graphs.

Mistake 3: Forgetting the domain restricts the identity too

Where it slips in: Identity functions defined on a limited set, as in Example 5.

Don't do this: Assume an identity function always covers all real numbers.

The correct way: The identity returns inputs unchanged only on its stated domain. On ${1, 2, 3}$ the range is ${1, 2, 3}$, not all reals.

Practice Questions

Try these, then check the answers below.

  1. Evaluate the identity function $f(x) = x$ at $x = -12$.

  2. Do the points $(7, 7)$ and $(7, 3)$ lie on the identity function?

  3. Compute $h \circ I$ for $h(x) = 2x + 1$, where $I(x) = x$.

  4. Find the range of the identity function on the domain ${-1, 0, 4}$.

  5. What is the inverse of the identity function, and what is its slope?

Answers

Answer to Question 1: $f(-12) = -12$, since the identity function returns its input unchanged.

Answer to Question 2: $(7, 7)$ lies on it (input equals output); $(7, 3)$ does not, since $7 \neq 3$.

Answer to Question 3: $h \circ I$ means apply $I$, then $h$: $h(I(x)) = h(x) = 2x + 1$. Composing with the identity leaves $h$ unchanged.

Answer to Question 4: Range $= {-1, 0, 4}$, identical to the domain.

Answer to Question 5: The identity function is its own inverse ($f^{-1} = f$), and its slope is $1$.

Conclusion

  • An identity function returns its input unchanged: $f(x) = x$.

  • Its graph is the straight line $y = x$ through the origin, with slope $1$ and a $45°$ angle to both axes.

  • Its domain and range are identical, and it is bijective and its own inverse.

  • It is the neutral element of function composition — composing with it changes nothing.

  • The common trap is confusing it with a constant function $f(x) = c$, which keeps the output fixed rather than the input.

Practice These Before Moving On

Work through the practice questions above to solidify your understanding. If you get stuck telling identity from constant, return to Example 2 and test a single input on both. At Bhanzu, trainers introduce the identity function as the composition twin of $0$ and $1$, so its role clicks before the graph is even drawn. Want a live Bhanzu trainer to walk through more identity function problems? Book a free demo class.

Was this article helpful?

Your feedback helps us write better content

Frequently Asked Questions

Is the identity function linear?
Yes. $f(x) = x$ has the form $f(x) = mx + b$ with $m = 1$ and $b = 0$, so it is a linear function — the simplest non-trivial one.
What is the difference between an identity function and a constant function?
The identity function returns its input unchanged ($f(x) = x$, a diagonal). A constant function returns the same fixed output for every input ($f(x) = c$, a horizontal line). Test any single value and the two split apart.
Is the identity function one-to-one and onto?
Yes to both — it is bijective. No two inputs share an output, and every value in the range is reached, which is why it is invertible.
What is the inverse of the identity function?
Itself. Since $f(f(x)) = x$, the identity function is its own inverse: $f^{-1} = f$.
Why is it called the "identity"?
Because it acts as the identity element for function composition — composing any function with it leaves that function unchanged, just as adding $0$ or multiplying by $1$ leaves a number unchanged.
✍️ Written By
BT
Bhanzu Team
Content Creator and Editor
Bhanzu’s editorial team, known as Team Bhanzu, is made up of experienced educators, curriculum experts, content strategists, and fact-checkers dedicated to making math simple and engaging for learners worldwide. Every article and resource is carefully researched, thoughtfully structured, and rigorously reviewed to ensure accuracy, clarity, and real-world relevance. We understand that building strong math foundations can raise questions for students and parents alike. That’s why Team Bhanzu focuses on delivering practical insights, concept-driven explanations, and trustworthy guidance-empowering learners to develop confidence, speed, and a lifelong love for mathematics.
Related Articles
Book a FREE Demo ClassBook Now →