Tutorials › Real Analysis › Inverse Functions

Sets and Functions · Tutorial 68 of 1000

Inverse Functions

An inverse function reverses a bijection by sending each output back to the unique input that produced it.

Beginner 12 min read

What You'll Learn

  • How a bijection defines an inverse function
  • Why the inverse reverses domain and codomain
  • How to verify the two inverse cancellation identities
  • How to calculate inverse functions in concrete examples
  • How to recognize when a function has no inverse function
  • Why inverse notation does not mean a reciprocal

Reversing a Bijection

An identity function leaves every element unchanged. A bijection has a complementary role: it matches each element of its codomain with exactly one element of its domain. This exact matching makes it possible to reverse the function. If \(f:A\to B\) is a bijection and \(b\in B\), there is exactly one \(a\in A\) for which \(f(a)=b\). The inverse sends \(b\) back to that \(a\).

The Bijective Functions tutorial established that a function has an inverse exactly when it is bijective. We now make that inverse concrete and study its properties. Throughout, the domain and codomain are part of the function specification: an inverse of a function from \(A\) to \(B\) goes from \(B\) to \(A\).

Definition (Inverse Function). Let \(f:A\to B\) be a bijection. For each \(b\in B\), there is exactly one \(a\in A\) such that \(f(a)=b\). Define \(f^{-1}:B\to A\) by $$ f^{-1}(b)=a \quad\Longleftrightarrow\quad f(a)=b. $$ The function \(f^{-1}\) is called the inverse of \(f\).

The existence and uniqueness of \(a\) for each \(b\) ensure that this rule assigns exactly one value in \(A\) to every input in \(B\), so it really is a function. In function notation, the defining relationship can also be written as \(f^{-1}(f(a))=a\) and \(f(f^{-1}(b))=b\), for \(a\in A\) and \(b\in B\). These identities will be proved below.

Inverse notation is not reciprocal notation. The symbol \(f^{-1}\) denotes the inverse function, whose input and output sets are reversed. It does not mean \(1/f\). For example, the inverse of a function is determined by reversing its input-output assignments, not by taking the reciprocal of each output.

Finding the Inverse from Its Definition

To find an inverse, begin with a prospective output \(b\) of \(f\) and solve \(f(a)=b\) for the original input \(a\). The result gives the value \(f^{-1}(b)\). This calculation is valid as an inverse function only if the original function is a bijection between the stated sets. Injectivity is needed so an output cannot correspond to two different inputs; surjectivity is needed so every element of the codomain has an input to return to.

Worked Example: A Bijection Between Finite Sets

Let \(A=\{r,s,t\}\), \(B=\{4,7,9\}\), and define \(f:A\to B\) by $$ f(r)=7,\qquad f(s)=9,\qquad f(t)=4. $$ Each element of \(B\) occurs exactly once as an output, so \(f\) is bijective. Reverse each assignment: \(7\) must return to \(r\), \(9\) to \(s\), and \(4\) to \(t\). Thus $$ f^{-1}(7)=r,\qquad f^{-1}(9)=s,\qquad f^{-1}(4)=t. $$ The inverse has domain \(B\), codomain \(A\), and graph $$ f^{-1}=\{(7,r),(9,s),(4,t)\}. $$ For instance, \(f^{-1}(f(s))=f^{-1}(9)=s\), while \(f(f^{-1}(4))=f(t)=4\).

The ordered pairs in the inverse graph are obtained by reversing the coordinates of the ordered pairs in the graph of \(f\). The graph pair \((r,7)\) becomes \((7,r)\). This describes the same reversal as the value rule, while the domain and codomain make clear which set supplies each input.

Worked Example: An Affine Function on the Real Numbers

Define \(f:\mathbb R\to\mathbb R\) by \(f(x)=3x-8\). To find the input that produces \(y\), solve $$ y=3x-8,\qquad y+8=3x,\qquad x=\frac{y+8}{3}. $$ Therefore the candidate inverse is \(f^{-1}:\mathbb R\to\mathbb R\), where \(f^{-1}(y)=(y+8)/3\). Verify both directions: $$ f^{-1}(f(x)) =\frac{(3x-8)+8}{3} =x \quad\text{for every }x\in\mathbb R, $$ and $$ f(f^{-1}(y)) =3\left(\frac{y+8}{3}\right)-8 =y \quad\text{for every }y\in\mathbb R. $$ The two equations verify that each function reverses the other. In particular, \(f\) is a bijection and the displayed formula is its inverse.

When a formula is used, it is useful to distinguish the variable names for the two sets. In \(f(x)\), the input \(x\) belongs to \(A\); in \(f^{-1}(y)\), the input \(y\) belongs to \(B\). The letters are only labels, but the set membership is not optional. It is possible to obtain an algebraic expression while overlooking that it is undefined for some elements of the claimed codomain, or that its values do not belong to the claimed domain.

The Cancellation Identities

For \(f:A\to B\) and \(f^{-1}:B\to A\), both compositions are defined. The composition \(f^{-1}\circ f\) maps \(A\) to \(A\), and \(f\circ f^{-1}\) maps \(B\) to \(B\). Each must be the identity function on the appropriate set: first applying \(f\) and then undoing it returns the original element of \(A\); first applying the inverse and then \(f\) returns the original element of \(B\).

Theorem (Cancellation Identities for an Inverse). Let \(f:A\to B\) be a bijection. Then $$ f^{-1}\circ f=\operatorname{id}_A \qquad\text{and}\qquad f\circ f^{-1}=\operatorname{id}_B. $$

Proof. The compositions are defined because the codomain of \(f\) is the domain of \(f^{-1}\), and the codomain of \(f^{-1}\) is the domain of \(f\). Let \(a\in A\). By the definition of composition and the definition of \(f^{-1}\), the unique input that \(f\) sends to \(f(a)\) is \(a\). Hence $$ (f^{-1}\circ f)(a)=f^{-1}(f(a))=a=\operatorname{id}_A(a). $$ This holds for every \(a\in A\), so the Pointwise Equality Criterion gives \(f^{-1}\circ f=\operatorname{id}_A\).

Now let \(b\in B\). By the definition of the inverse, \(f^{-1}(b)\) is the element of \(A\) that \(f\) sends to \(b\). Therefore $$ (f\circ f^{-1})(b)=f(f^{-1}(b))=b=\operatorname{id}_B(b). $$ This holds for every \(b\in B\), so the Pointwise Equality Criterion gives \(f\circ f^{-1}=\operatorname{id}_B\). If either set is empty, bijectivity forces both to be empty; the pointwise equality criterion still applies to the functions with empty domain. Thus both identities hold in that case as well. \(\square\)

The two equations have different types and should not be interchanged. The first composition ends where it began on \(A\), and the second ends where it began on \(B\). These are precisely the identity functions from the preceding tutorial, now appearing as the result of composing a function with its inverse.

1
Identify the sets: write the function as \(f:A\to B\), with inverse \(f^{-1}:B\to A\).
2
Reverse the assignment: for a given \(b\in B\), find the unique \(a\in A\) satisfying \(f(a)=b\).
3
Check the first composition: \(f^{-1}\circ f\) is a function from \(A\) to \(A\), and it should return every \(a\) to itself.
4
Check the other composition: \(f\circ f^{-1}\) is a function from \(B\) to \(B\), and it should return every \(b\) to itself.
5
Confirm the claimed types: each inverse value lies in \(A\), and the inverse accepts every element of \(B\).

The Inverse Is Itself a Bijection

Reversing a bijection produces another bijection. Injectivity of the inverse follows because two inputs that the inverse sends to the same element of \(A\) must both be sent by \(f\) to that element. Surjectivity follows because any \(a\in A\) is reached by applying \(f^{-1}\) to \(f(a)\). The argument uses the defining relationship between a function and its inverse.

Theorem (The Inverse of a Bijection Is Bijective). If \(f:A\to B\) is a bijection, then \(f^{-1}:B\to A\) is a bijection.

Proof. To prove injectivity, let \(b_1,b_2\in B\) and suppose \(f^{-1}(b_1)=f^{-1}(b_2)\). Apply \(f\) to both sides. The inverse definition gives $$ f(f^{-1}(b_1))=f(f^{-1}(b_2)), $$ so \(b_1=b_2\). Therefore \(f^{-1}\) is injective.

To prove surjectivity, let \(a\in A\) be arbitrary. Since \(f(a)\in B\), it is a valid input to \(f^{-1}\). By the cancellation identity, $$ f^{-1}(f(a))=a. $$ Thus \(a\) is attained by \(f^{-1}\), and every element of its codomain \(A\) is attained. Hence \(f^{-1}\) is surjective, and therefore bijective. If the sets are empty, the same defining conditions hold vacuously, so the conclusion remains valid. \(\square\)

Worked Example: A Bijection from the Integers to the Odd Integers

Let \(O=\{m\in\mathbb Z:m\text{ is odd}\}\), and define \(f:\mathbb Z\to O\) by \(f(n)=2n+1\). Every output is odd. If \(f(n_1)=f(n_2)\), then \(2n_1+1=2n_2+1\), so \(n_1=n_2\), proving injectivity. For any \(m\in O\), the definition of oddness gives an integer \(k\) such that \(m=2k+1\), and then \(f(k)=m\). Thus \(f\) is surjective onto \(O\).

Solving \(m=2n+1\) for \(n\) gives \(n=(m-1)/2\). Since \(m\) is odd, this number is an integer. Hence $$ f^{-1}:O\to\mathbb Z,\qquad f^{-1}(m)=\frac{m-1}{2}. $$ For example, \(f^{-1}(11)=5\), because \(f(5)=11\), and \(f^{-1}(-3)=-2\), because \(f(-2)=-3\). The formula is not being claimed on all of \(\mathbb Z\); its domain is specifically the odd integers.

When an Inverse Function Does Not Exist

A rule may be reversible for some inputs but fail to define a function from the stated codomain back to the stated domain. If two distinct inputs have the same output, reversing the assignments would require that output to be sent to two different inputs. If some element of the stated codomain is never an output, the reversed rule would have no value for that element. These are exactly the failures of injectivity and surjectivity.

Worked Example: Why Squaring on the Real Numbers Has No Inverse Function

Consider \(q:\mathbb R\to\mathbb R\), defined by \(q(x)=x^2\). It is not injective because \(q(2)=4=q(-2)\), while \(2\ne-2\). A reversed assignment would have to send \(4\) to both \(2\) and \(-2\), so it would not be a function. Also, \(q\) is not surjective onto \(\mathbb R\), since no real \(x\) satisfies \(x^2=-1\). Thus the failure is visible in both conditions required for bijectivity.

Changing the domain and codomain can change the conclusion. For example, the rule \(q:[0,\infty)\to[0,\infty)\), \(q(x)=x^2\), is bijective and has an inverse function. Its inverse is the nonnegative square-root function on \([0,\infty)\). This does not contradict the previous conclusion: it is a different function because its domain and codomain have been specified differently.

Check the function type before manipulating a formula. A formula alone does not establish that an inverse exists. First determine whether the given function is a bijection from its stated domain onto its stated codomain. If a restriction is needed to obtain bijectivity, that restriction changes the function and must be stated.

Uniqueness and a Useful Composition Rule

An inverse is not one of several possible functions that happen to undo the original in a convenient way. If a function satisfies both cancellation identities, it must be the inverse. This gives a way to verify an inverse without relying solely on an algebraic rearrangement.

Theorem (Uniqueness from the Cancellation Identities). Let \(f:A\to B\) be a bijection. If \(g:B\to A\) satisfies $$ g\circ f=\operatorname{id}_A \qquad\text{and}\qquad f\circ g=\operatorname{id}_B, $$ then \(g=f^{-1}\).

Proof. Let \(b\in B\). The assumption \(f\circ g=\operatorname{id}_B\) gives \(f(g(b))=b\). The definition of \(f^{-1}\) says that \(f^{-1}(b)\) is the unique element of \(A\) that \(f\) sends to \(b\). Since \(g(b)\in A\) and \(f(g(b))=b\), uniqueness implies \(g(b)=f^{-1}(b)\). This holds for every \(b\in B\), so the Pointwise Equality Criterion gives \(g=f^{-1}\). \(\square\)

The second cancellation identity already identifies the value of \(g\) at each element of \(B\); the first identity is consistent with that reversal. Requiring both identities is a symmetric way to state that the two functions undo one another. The uniqueness conclusion relies on \(f\) being a bijection, so each \(b\) has exactly one preimage.

Inverses also reverse the order of composition. If \(f:A\to B\) and \(g:B\to C\) are bijections, then \(g\circ f:A\to C\) is a bijection, and $$ (g\circ f)^{-1}=f^{-1}\circ g^{-1}. $$ The order on the right is reversed because undoing the combined process means first undoing \(g\), then undoing \(f\). To verify the formula, compose the proposed inverse on the left with \(g\circ f\): $$ (f^{-1}\circ g^{-1})\circ(g\circ f) =f^{-1}\circ(g^{-1}\circ g)\circ f =f^{-1}\circ\operatorname{id}_B\circ f =\operatorname{id}_A. $$ Here associativity of composition and the identity laws are used. In the other order, $$ (g\circ f)\circ(f^{-1}\circ g^{-1}) =g\circ(f\circ f^{-1})\circ g^{-1} =g\circ\operatorname{id}_B\circ g^{-1} =\operatorname{id}_C. $$ Thus the candidate \(f^{-1}\circ g^{-1}:C\to A\) satisfies both cancellation identities for \(g\circ f\). By the uniqueness theorem, it is \((g\circ f)^{-1}\).

The inverse notation therefore records an operation on functions, not a pointwise reciprocal. Its essential features are a bijection to ensure a unique reverse assignment, a reversed domain and codomain, and two cancellation identities that return inputs to their original sets. Keeping these features in view prevents common errors when calculating or composing inverse functions.

Check Your Understanding

  1. Let \(f:A\to B\) be a bijection. State the domain and codomain of \(f^{-1}\), and describe how \(f^{-1}(b)\) is determined.
  2. For \(f:\mathbb R\to\mathbb R\) defined by \(f(x)=5x+2\), solve \(y=5x+2\) for \(x\) to obtain the candidate inverse formula.
  3. State both cancellation identities for a bijection \(f:A\to B\), including the correct identity-function subscripts.
  4. Explain why \(q(x)=x^2\), specified as a function \(\mathbb R\to\mathbb R\), cannot have an inverse function.
  5. If \(f:A\to B\) and \(g:B\to C\) are bijections, what is the inverse of \(g\circ f\), and why is the order reversed?
  6. What does the notation \(f^{-1}\) mean, and how does its meaning differ from a reciprocal such as \(1/f\)?