Tutorials › Real Analysis › Inverses and Composition

Sets and Functions · Tutorial 75 of 1000

Inverses and Composition

For bijections, the inverse of a composite is the composite of the inverses in reverse order.

Beginner 10 min read

What You'll Learn

  • Identify the domains and codomains of inverse functions in a composition
  • Prove the formula for the inverse of a composite of bijections
  • Apply the formula to real-valued functions and finite sets
  • Extend the rule to a composition of three bijections
  • Recognize why reversing the order matters

Reversing a Composition

Let \(f:A\to B\) and \(g:B\to C\) be bijections. Their composition \(g\circ f:A\to C\) applies \(f\) first and \(g\) second. To undo that process, we must first undo \(g\), then undo \(f\). This suggests that the inverse of \(g\circ f\) should be \(f^{-1}\circ g^{-1}\), with the order reversed.

The formula is meaningful because the domains and codomains fit: \(g^{-1}:C\to B\), and \(f^{-1}:B\to A\), so \(f^{-1}\circ g^{-1}\) maps \(C\) to \(A\). The inverse function \(f^{-1}\) is defined here only because \(f\) is bijective, as established in “Inverse Functions.” This notation is different from \(f^{-1}[S]\), which denotes the preimage of a set and is defined even when \(f\) is not bijective.

Key idea. To undo a sequence of functions, undo the last function first. For bijections \(f:A\to B\) and \(g:B\to C\), this gives the candidate \(f^{-1}\circ g^{-1}\) for the inverse of \(g\circ f\).

The Inverse of a Composition

The candidate can be verified using the cancellation identities for inverse functions. For a bijection \(f\), those identities are \(f^{-1}\circ f=\operatorname{id}_A\) and \(f\circ f^{-1}=\operatorname{id}_B\). Checking both orders of composition confirms that the candidate is an inverse on the correct domain and codomain.

Theorem (Inverse of a Composition). Let \(f:A\to B\) and \(g:B\to C\) be bijections. Then \(g\circ f:A\to C\) is a bijection and
$$ (g\circ f)^{-1}=f^{-1}\circ g^{-1}. $$

Proof. Since \(f\) and \(g\) are bijections, they are both injective and surjective. By the earlier results on injectivity and surjectivity of compositions, \(g\circ f\) is injective and surjective, hence bijective. Therefore it has an inverse function.

Set \(h=f^{-1}\circ g^{-1}:C\to A\). We check the two cancellation identities for \(g\circ f\). By associativity of composition and the cancellation identities for \(f\) and \(g\),

$$ \begin{aligned} h\circ(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. \end{aligned} $$

In the other order, the same identities give

$$ \begin{aligned} (g\circ f)\circ h &=(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. \end{aligned} $$

Thus \(h\) satisfies both cancellation identities for the bijection \(g\circ f\). By the uniqueness result for a function satisfying these identities, \(h\) is its inverse. Therefore \((g\circ f)^{-1}=f^{-1}\circ g^{-1}\). \(\square\)

Both identities matter: the first shows that undoing the composite after applying it returns every element of \(A\), and the second shows that applying the composite after undoing it returns every element of \(C\). The domains \(A\) and \(C\) need not be the same, so these are different identity functions.

Worked Example: A Composite of Real-Valued Bijections

Define \(f:\mathbb R\to\mathbb R\) and \(g:\mathbb R\to\mathbb R\) by \(f(x)=x^3+1\) and \(g(x)=2x-3\). Both functions are bijections. Solving \(y=x^3+1\) for \(x\) gives \(f^{-1}(y)=\sqrt[3]{y-1}\), while solving \(y=2x-3\) gives \(g^{-1}(y)=(y+3)/2\).

The composite is

$$ (g\circ f)(x)=g(x^3+1)=2(x^3+1)-3=2x^3-1. $$

Solving \(y=2x^3-1\) for \(x\) gives \((g\circ f)^{-1}(y)=\sqrt[3]{(y+1)/2}\). The composition formula gives the same answer:

$$ (f^{-1}\circ g^{-1})(y) =f^{-1}\left(\frac{y+3}{2}\right) =\sqrt[3]{\frac{y+3}{2}-1} =\sqrt[3]{\frac{y+1}{2}}. $$

For example, at \(y=15\), both expressions give \(\sqrt[3]{8}=2\). Indeed, \((g\circ f)(2)=2(8)-1=15\), so the inverse correctly returns \(2\).

Checking the Order and the Types

The order in the formula follows from the order in which functions act. In \(g\circ f\), the first step is \(f\) and the last step is \(g\). Reversing the process means applying \(g^{-1}\) first and \(f^{-1}\) second. Since composition notation lists the function applied first on the right, the inverse is \(f^{-1}\circ g^{-1}\).

The domains and codomains are a useful check against an order error. The inverse of \(g\circ f\) must map \(C\) to \(A\). The expression \(f^{-1}\circ g^{-1}\) has exactly this type:

$$ C\xrightarrow{\ g^{-1}\ }B\xrightarrow{\ f^{-1}\ }A. $$

By contrast, \(g^{-1}\circ f^{-1}\) is generally not even defined: \(f^{-1}\) maps \(B\) to \(A\), but \(g^{-1}\) expects an input in \(C\). Even when the sets happen to coincide so that the reversed expression can be formed, it need not give the inverse.

Worked Example: Inverse Maps on Finite Sets

Let \(A=\{p,q,r\}\), \(B=\{1,2,3\}\), and \(C=\{\alpha,\beta,\gamma\}\). Define bijections by

$$ f(p)=2,\quad f(q)=3,\quad f(r)=1, \qquad g(1)=\beta,\quad g(2)=\gamma,\quad g(3)=\alpha. $$

Applying \(f\) and then \(g\) gives

$$ (g\circ f)(p)=\gamma,\qquad (g\circ f)(q)=\alpha,\qquad (g\circ f)(r)=\beta. $$

The inverse of this composite sends \(\gamma\) to \(p\), \(\alpha\) to \(q\), and \(\beta\) to \(r\). The component inverses are \(g^{-1}(\beta)=1\), \(g^{-1}(\gamma)=2\), \(g^{-1}(\alpha)=3\), and \(f^{-1}(1)=r\), \(f^{-1}(2)=p\), \(f^{-1}(3)=q\). For instance,

$$ (f^{-1}\circ g^{-1})(\gamma) =f^{-1}(g^{-1}(\gamma)) =f^{-1}(2) =p. $$

Likewise, \((f^{-1}\circ g^{-1})(\alpha)=f^{-1}(3)=q\) and \((f^{-1}\circ g^{-1})(\beta)=f^{-1}(1)=r\). These are exactly the values of \((g\circ f)^{-1}\), confirming the formula on every element of \(C\).

More Than Two Functions

The same reasoning applies to longer sequences. Each time a new function is added to the end of a composition, its inverse is placed at the beginning of the inverse composition. Associativity, established earlier in “Composition of Functions,” allows us to group the original composition in either order without changing the function.

Theorem (Inverse of a Composition of Three Bijections). Let \(f:A\to B\), \(g:B\to C\), and \(k:C\to D\) be bijections. Then
$$ (k\circ g\circ f)^{-1}=f^{-1}\circ g^{-1}\circ k^{-1}. $$

Proof. By the Inverse of a Composition theorem, the inverse of \((k\circ g)\circ f\) is \(f^{-1}\circ(k\circ g)^{-1}\). Applying that theorem to \(k\circ g\) gives \((k\circ g)^{-1}=g^{-1}\circ k^{-1}\). Substitution yields

$$ ((k\circ g)\circ f)^{-1} =f^{-1}\circ(g^{-1}\circ k^{-1}) =f^{-1}\circ g^{-1}\circ k^{-1}, $$

where the final grouping is justified by associativity. Since \((k\circ g)\circ f=k\circ g\circ f\), this is the claimed formula. \(\square\)

Worked Example: Why Reversing the Order Matters

Define \(f:\mathbb R\to\mathbb R\) by \(f(x)=x+1\) and \(g:\mathbb R\to\mathbb R\) by \(g(x)=2x\). Their inverses are \(f^{-1}(x)=x-1\) and \(g^{-1}(x)=x/2\). Since \(g\circ f\) first adds \(1\) and then doubles,

$$ (g\circ f)(x)=2(x+1)=2x+2, \qquad (g\circ f)^{-1}(y)=\frac{y}{2}-1. $$

The theorem gives

$$ (f^{-1}\circ g^{-1})(y) =f^{-1}\left(\frac y2\right) =\frac y2-1, $$

as required. If the order is mistakenly left unchanged, then

$$ (g^{-1}\circ f^{-1})(y)=\frac{y-1}{2}. $$

At \(y=0\), the correct inverse gives \(-1\), while the incorrectly ordered expression gives \(-1/2\). Substitution confirms the difference: \((g\circ f)(-1)=0\), but \((g\circ f)(-1/2)=1\), not \(0\). The order reversal is essential, not just a notational convention.

When the Formula Can Be Used

The inverse-of-a-composition formula requires both component functions to be bijections, so that both inverse functions exist with the stated domains and codomains. It is not enough that a composite happens to be bijective if the individual functions are not. For example, let \(f:\{1\}\to\{1,2\}\) be given by \(f(1)=1\), and let \(g:\{1,2\}\to\{1\}\) be the constant function \(g(1)=g(2)=1\). Then \(g\circ f\) is the identity on \(\{1\}\), which is a bijection, yet neither \(f\) nor \(g\) is a bijection, so the expression \(f^{-1}\circ g^{-1}\) is unavailable as a composition of inverse functions.

Keep the distinction between inverse functions and preimages of sets in view. The notation \(f^{-1}[S]\) for a set \(S\) means the set of inputs whose \(f\)-values lie in \(S\); it does not assert that \(f\) has an inverse function. The formula in this tutorial concerns inverse functions and is used only when the functions are bijective.

Key takeaway. For bijections \(f:A\to B\) and \(g:B\to C\), the inverse of \(g\circ f\) is \(f^{-1}\circ g^{-1}\). Check the order by tracking the steps needed to undo the original composition, and check the types to ensure the resulting function maps \(C\) to \(A\).

Check Your Understanding

Use the domains, codomains, and cancellation identities to justify each answer.

  1. For bijections \(f:A\to B\) and \(g:B\to C\), state the formula for \((g\circ f)^{-1}\) and give its domain and codomain.
  2. Why must the order of the inverse functions be reversed?
  3. If \(f(x)=x-4\) and \(g(x)=3x\) on \(\mathbb R\), write the inverse of \(g\circ f\) using \(f^{-1}\) and \(g^{-1}\).
  4. In the proof of the Inverse of a Composition theorem, what does each of the two cancellation identities verify?
  5. State the inverse formula for a composition of three bijections \(f:A\to B\), \(g:B\to C\), and \(k:C\to D\).