Relations and Functions • Topic 3 of 3

Composition of Functions & Invertible Functions

Once we have functions we can chain them and, when they are bijective, reverse them. These two ideas — composition and inverse — are the practical payoff of one-one and onto.

Composition of functions

Given $f:A\to B$ and $g:B\to C$, the composite $g\circ f : A \to C$ is defined by

$$(g\circ f)(x) = g\big(f(x)\big).$$

You apply $f$ first, then feed the result into $g$. For the composite to make sense, the range of $f$ must sit inside the domain of $g$. Two key facts:

  • Not commutative: in general $g\circ f \ne f\circ g$.
  • Associative: $h\circ(g\circ f) = (h\circ g)\circ f$, so we can drop the brackets.

The identity function $I_A(x)=x$ acts as a "do nothing" map: $f\circ I_A = f = I_B \circ f$.

Invertible functions

A function $f:A\to B$ is invertible if there is a function $g:B\to A$ that undoes it:

$$g\circ f = I_A \quad\text{and}\quad f\circ g = I_B.$$

Such a $g$ is unique; we call it the inverse and write $f^{-1}$. The central theorem of this chapter:

$f$ is invertible $\iff$ $f$ is bijective (one-one and onto).

This is why we spent the previous page classifying functions: only a bijection can be inverted. Note $f^{-1}$ is the inverse function, not the reciprocal $1/f$.

Properties of the inverse

  • $(f^{-1})^{-1} = f$ — inverting twice returns the original.
  • $f^{-1}\big(f(x)\big)=x$ and $f\big(f^{-1}(y)\big)=y$.
  • Reversal law: if $f$ and $g$ are bijections, then $(g\circ f)^{-1} = f^{-1}\circ g^{-1}$ ("socks and shoes": undo in reverse order).

Finding an inverse — the method

  1. Confirm $f$ is bijective (so the inverse exists).
  2. Write $y=f(x)$.
  3. Solve the equation for $x$ in terms of $y$.
  4. Swap symbols to express $f^{-1}(y)$ (or rename $y$ as $x$).
1
Worked Example
If $f(x)=2x+1$ and $g(x)=x^2$, find $(g\circ f)(x)$ and $(f\circ g)(x)$, and verify they are different.
Solution

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

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

At $x=1$: $(g\circ f)(1)=9$ while $(f\circ g)(1)=3$. They disagree, confirming composition is not commutative.

2
Worked Example
Show that $f:\mathbb{R}\to\mathbb{R},\ f(x)=2x+3$ is invertible and find $f^{-1}$.
Solution

From the previous page, $f(x)=2x+3$ is bijective, so it is invertible.

Put $y=2x+3$. Solve for $x$: $x=\dfrac{y-3}{2}$. Therefore

$$f^{-1}(y)=\frac{y-3}{2}, \qquad \text{or} \qquad f^{-1}(x)=\frac{x-3}{2}.$$

Check: $f^{-1}(f(x)) = \dfrac{(2x+3)-3}{2} = x$. Correct.

3
Worked Example
Let $f:\mathbb{R}\setminus\{2\}\to\mathbb{R}\setminus\{1\}$ be $f(x)=\dfrac{x}{x-2}$. Find $f^{-1}$.
Solution

Put $y=\dfrac{x}{x-2}$. Then $y(x-2)=x \Rightarrow yx-2y = x \Rightarrow yx - x = 2y \Rightarrow x(y-1)=2y$.

So $x=\dfrac{2y}{y-1}$ (valid since $y\ne 1$). Hence

$$f^{-1}(x)=\frac{2x}{x-1}.$$

Check at a point: $f(0)=\dfrac{0}{-2}=0$ and $f^{-1}(0)=\dfrac{0}{-1}=0$. Consistent.

4
Worked Example
With $f(x)=x+1$ and $g(x)=3x$, verify the reversal law $(g\circ f)^{-1}=f^{-1}\circ g^{-1}$.
Solution

First, $(g\circ f)(x)=g(x+1)=3(x+1)=3x+3$. Inverting: set $y=3x+3 \Rightarrow x=\dfrac{y-3}{3}$, so $(g\circ f)^{-1}(x)=\dfrac{x-3}{3}$.

Next, $f^{-1}(x)=x-1$ and $g^{-1}(x)=\dfrac{x}{3}$. Then $(f^{-1}\circ g^{-1})(x)=f^{-1}\!\left(\dfrac{x}{3}\right)=\dfrac{x}{3}-1=\dfrac{x-3}{3}$.

Both sides equal $\dfrac{x-3}{3}$, so the reversal law holds.

Key Points

  • Composition: $(g\circ f)(x)=g(f(x))$ — apply $f$ first, then $g$.
  • Composition is associative but not commutative: usually $g\circ f \ne f\circ g$.
  • Identity function $I(x)=x$ satisfies $f\circ I = I\circ f = f$.
  • $f$ is invertible $\iff$ bijective; the inverse $f^{-1}$ is unique.
  • $(f^{-1})^{-1}=f$ and reversal law $(g\circ f)^{-1}=f^{-1}\circ g^{-1}$.
  • To find $f^{-1}$: set $y=f(x)$, solve for $x$, then rename.
Tap an option to check your answer0 / 4
Q1.If $f(x)=x+2$ and $g(x)=3x$, then $(g\circ f)(2)$ equals:
Explanation: $(g\circ f)(2)=g(f(2))=g(4)=3\times 4 = 12$.
Q2.A function $f:A\to B$ is invertible if and only if it is:
Explanation: An inverse exists exactly when every output has a unique pre-image, which means $f$ must be both one-one and onto.
Q3.If $f(x)=3x-5$, then $f^{-1}(x)$ is:
Explanation: Set $y=3x-5 \Rightarrow x=\dfrac{y+5}{3}$. So $f^{-1}(x)=\dfrac{x+5}{3}$. (Note $f^{-1}$ is the inverse, not the reciprocal.)
Q4.For bijections $f$ and $g$, $(g\circ f)^{-1}$ equals:
Explanation: The reversal ("socks and shoes") law: undo the last-applied function first, so $(g\circ f)^{-1}=f^{-1}\circ g^{-1}$.