This topic is about functions: the words used to describe them, their domain and range, the modulus of a function, inverse functions, composite functions, and the graph of a function together with its inverse.
1.1 Function terms: domain, range, one–one, inverse, composition
Learn these words well: every later functions 函数 question uses them.
Function, domain and range
A function is a rule that takes an input $x$ and gives exactly one output $f(x)$.
- The domain 域 is the set of inputs you are allowed to use. It is usually given after the rule, for example "for $x \in \mathbb{R}$" (all real numbers) or "for $x > 0$".
- The range 范围 (also called the image set 像集) is the set of all outputs the function can give.

Explaining why a rule is a function. Write one sentence with the key words each and exactly one:
For each value of $x$ in the domain there is exactly one value of $f(x)$.
One–one and many–one
- A one–one function 一对一函数: different inputs always give different outputs.
- A many–one function 多对一函数: at least two different inputs give the same output.
Test with a graph. Draw horizontal lines across the graph over the domain. If any line meets the graph more than once, the function is many–one.
Worked example 1. $f(x) = x^2$ for $x \in \mathbb{R}$. Is $f$ one–one or many–one?
- Look for two inputs with the same output: $f(2) = 4$ and $f(-2) = 4$.
- So $f$ is many–one. One counterexample is enough.
Worked example 2. $g(x) = x^2$ for $x \geqslant 0$. Is $g$ one–one?
- The domain now has no negative numbers, so $-2$ cannot be used.
- On $x \geqslant 0$ the graph only rises, so every horizontal line meets it at most once.
- So $g$ is one–one. The same rule can be one–one or many–one: it depends on the domain.
Range from a sketch
Worked example 3. $h(x) = x^2 + 3$ for $x \in \mathbb{R}$. Find the range of $h$.
- $x^2 \geqslant 0$ for every real $x$.
- Add 3: $x^2 + 3 \geqslant 3$, and $h(0) = 3$, so the value 3 is reached.
- Range: $h(x) \geqslant 3$.
Write a range in terms of $f(x)$ (or $y$), not $x$: "$h(x) \geqslant 3$", not "$x \geqslant 3$".
Inverse and composite functions
- The inverse function 反函数 $f^{-1}$ undoes $f$: if $f(2) = 5$, then $f^{-1}(5) = 2$.
- Only a one–one function has an inverse. In a many–one function, one output comes from two inputs, so "going back" would give two answers, and that is not a function.
- A composite function 复合函数 applies one function after another. $fg(x)$ means $f(g(x))$: do $g$ first, then $f$.
Worked example 4. $f(x) = 2x + 1$ and $g(x) = x^2$. Find $fg(3)$ and $gf(3)$.
- $fg(3)$: first $g(3) = 9$, then $f(9) = 2(9) + 1 = 19$.
- $gf(3)$: first $f(3) = 7$, then $g(7) = 49$.
- $fg(3) \neq gf(3)$: the order 目 matters.
1.2 Domain and range of functions
The range is where most marks are lost. Always look at the whole domain, not only its ends.
The range of a function on a domain
The domain is the set of inputs. The range is the set of outputs you get from those inputs. To find the range:
- Sketch the graph over the domain only.
- Find the lowest and highest points of that piece. Check the ends of the domain and any turning point 转折点 inside it.
- Write the range with $f(x)$, using $<$ or $\leqslant$ correctly.
Worked example 1. $f(x) = (x - 2)^2 + 1$ for $0 \leqslant x \leqslant 5$. Find the range of $f$.

The graph shows why the ends are not enough: the curve goes down to its lowest point before it rises.
- Ends: $f(0) = 5$ and $f(5) = 10$.
- Turning point inside the domain: $(x-2)^2 \geqslant 0$, so the least value is $1$, at $x = 2$.
- Highest value: $10$. So the range is $1 \leqslant f(x) \leqslant 10$ (not $5 \leqslant f(x) \leqslant 10$).
Completing the square to find a range
To find the least value of a quadratic, write it as $(x + p)^2 + q$. Then the least value is $q$, because a square is never negative.
Worked example 2. $f(x) = x^2 - 8x + 3$ for $x \in \mathbb{R}$.
- Half of $-8$ is $-4$: $x^2 - 8x + 3 = (x - 4)^2 - 16 + 3 = (x - 4)^2 - 13$.
- $(x - 4)^2 \geqslant 0$, so $f(x) \geqslant -13$.
- Range: $f(x) \geqslant -13$.
Exponential functions, and which inputs are allowed
- $e^x$ is always positive: $e^x > 0$ for every $x$, but it never reaches 0. So $3e^x + 2 > 2$, with a strict $>$.
- Some rules only work for some inputs. You cannot take the square root of a negative number, and $\ln x$ needs $x > 0$.
Worked example 3. Find the largest possible domain 最大可能定义域 of $h(x) = \sqrt{x - 3}$.
- The number under the root must not be negative: $x - 3 \geqslant 0$.
- Largest domain: $x \geqslant 3$.
Inverse functions swap domain and range
The inverse function $f^{-1}$ goes back from outputs to inputs, so
- domain of $f^{-1}$ = range of $f$,
- range of $f^{-1}$ = domain of $f$.
Worked example 4. $f(x) = (x - 2)^2 + 1$ for $x \geqslant 2$. State the domain and range of $f^{-1}$.
- Range of $f$: $f(x) \geqslant 1$. Domain of $f$: $x \geqslant 2$.
- Swap: domain of $f^{-1}$ is $x \geqslant 1$; range of $f^{-1}$ is $f^{-1}(x) \geqslant 2$.
Composite functions: when does $gf$ exist?
For $gf(x) = g(f(x))$, every output of $f$ must be an allowed input of $g$:
$gf$ exists only if the range of $f$ lies inside the domain of $g$.
To find the range of $gf$, put the range of $f$ into $g$.
Worked example 5. $f(x) = x^2 + 2$ for $x \in \mathbb{R}$ and $g(x) = 3x - 1$ for $x \in \mathbb{R}$. Find the range of $gf$.
- Range of $f$: $f(x) \geqslant 2$.
- $g$ is increasing, so put in the smallest output of $f$: $g(2) = 3(2) - 1 = 5$.
- Range of $gf$: $gf(x) \geqslant 5$.
1.3 Function notation
Exam questions write functions in several ways. Read each one correctly before you start.
Two ways to write a function
$f(x) = 3x^2 - 1$ and $f : x \mapsto 3x^2 - 1$ mean the same thing. Read $f : x \mapsto 3x^2 - 1$ as "$f$ maps $x$ to $3x^2 - 1$".
Substitute 替代品 means replace every $x$ by the new input, in brackets.
Worked example 1. $f : x \mapsto 3x^2 - 1$. Find $f(2)$, $f(-1)$ and $f(2a)$.
- $f(2) = 3(2)^2 - 1 = 12 - 1 = 11$.
- $f(-1) = 3(-1)^2 - 1 = 3 - 1 = 2$. The bracket keeps the sign right.
- $f(2a) = 3(2a)^2 - 1 = 3 \times 4a^2 - 1 = 12a^2 - 1$.
Composite notation: $fg(x)$ and $f^2(x)$
- $fg(x) = f(g(x))$: do $g$ first, then $f$.
- $f^2(x) = f(f(x))$: do $f$, then do $f$ again. It does not mean $[f(x)]^2$.

The machines show the order: the function written nearest to $x$ acts first.
Worked example 2. $f(x) = 2x + 3$. Find $f^2(x)$ and check it with $x = 1$.
- Put $f(x)$ into $f$: $f^2(x) = f(2x + 3) = 2(2x + 3) + 3 = 4x + 9$.
- Check: $f(1) = 5$ and $f(5) = 13$; also $4(1) + 9 = 13$. ✓
The inverse notation $f^{-1}$
$f^{-1}(x)$ is the inverse function. It answers the question "which input gave this output?"
- If $f(4) = 11$, then $f^{-1}(11) = 4$.
- $f^{-1}(x)$ is not $\dfrac{1}{f(x)}$.
Worked example 3. $f(x) = 2x + 3$. Find $f^{-1}(11)$.
- Solve $f(x) = 11$: $2x + 3 = 11$, so $x = 4$.
- $f^{-1}(11) = 4$. (Compare $\dfrac{1}{f(11)} = \dfrac{1}{25}$, a different number.)
Solving $f(x) = k$, and the domain
Write the equation, solve it, then check every answer is in the domain.
Worked example 4. $f(x) = x^2 - 3$ for $x > 0$. Solve $f(x) = 13$.
- $x^2 - 3 = 13$, so $x^2 = 16$ and $x = 4$ or $x = -4$.
- The domain is $x > 0$, so reject $-4$. Answer: $x = 4$.
$\lg$ and $\ln$
- $\lg x$ means $\log_{10} x$: the power of 10 that gives $x$. So $\lg 1000 = 3$, because $10^3 = 1000$.
- $\ln x$ means $\log_e x$, the same idea with base $e$.
- To undo $\lg$: if $\lg x = 2$, then $x = 10^2 = 100$.
1.4 Relationship between y = f(x) and y = |f(x)| y = f(x)y = |f(x)|
One rule turns any graph $y = f(x)$ into the graph of $y = |f(x)|$.
The rule: reflect what is below the $x$-axis
The modulus 模 $|a|$ is the size of $a$ without its sign: $|5| = 5$ and $|-5| = 5$. So $|f(x)|$ is never negative.
To sketch $y = |f(x)|$:
- Sketch $y = f(x)$ first.
- Keep every part that is on or above the $x$-axis.
- Reflect 翻转 every part below the $x$-axis in the $x$-axis: a point $(a, -b)$ moves to $(a, b)$.
- Label the points where the graph meets the axes, and any turning points.
Worked example 1. Sketch $y = |2x - 4|$ and $y = |(x - 1)(x - 5)|$.

The dashed parts are the original graphs below the axis; the solid graphs are the answers.
- Line. $2x - 4 = 0$ at $x = 2$. Left of $x = 2$ the line is below the axis, so it is reflected. The graph is a V with its vertex at $(2, 0)$; it meets the $y$-axis at $|{-4}| = 4$.
- Quadratic. The roots are $x = 1$ and $x = 5$. Between them the curve is below the axis, with its minimum at $(3, -4)$. After the reflection 反射 this becomes a maximum point 极大值点 $(3, 4)$. The $y$-intercept is $|(0-1)(0-5)| = 5$.
How many solutions does $|f(x)| = k$ have?
Draw the horizontal line $y = k$ on the sketch and count the crossing points. For $y = |(x - 1)(x - 5)|$ above:
| value of $k$ | $k = 0$ | $0 < k < 4$ | $k = 4$ | $k > 4$ |
|---|---|---|---|---|
| number of solutions | 2 | 4 | 3 | 2 |
The number changes at $k = 4$, the height of the reflected turning point.
Trigonometric graphs
The rule is the same for a trigonometric graph. Exam questions use $y = a\sin bx + c$, $a\cos bx + c$ or $a\tan bx + c$.
Worked example 2. The graph of $y = 2\cos x - 1$ for $0 \leqslant x \leqslant 2\pi$ goes from $1$ down to $-3$ and back to $1$. Sketch $y = |2\cos x - 1|$ and state its range.

- The part below the axis, between the two roots, is reflected. Its lowest point $(\pi, -3)$ becomes $(\pi, 3)$.
- The greatest value is now $3$ and the least value is $0$ (at the roots).
- Range: $0 \leqslant |2\cos x - 1| \leqslant 3$.
1.5 Why a function does not have an inverse
This is usually a 1-mark question. The mark needs the right reason in words, not only "it has no inverse".
The reason: many–one
A function has an inverse only if it is one–one. If two inputs give the same output, the inverse would have to send that output back to two places, so it would not be a function.
The answer sentence:
$f$ is many–one (not one–one), so $f$ has no inverse.
Make it stronger by giving two inputs with the same output, or by pointing to the turning point inside the domain.
Use the graph: one horizontal line, two points

On the left, the line $y = 3$ meets the curve twice, so $f$ is many–one. On the right the domain starts at the turning point, so no horizontal line meets the curve twice.
Worked example 1. $f(x) = (x - 1)^2 + 2$ for $-1 \leqslant x \leqslant 4$. Explain why $f$ has no inverse.
- The turning point is at $x = 1$, which is inside the domain.
- So the curve goes down and then up: $f(0) = 3$ and $f(2) = 3$.
- Answer: $f$ is many–one, because $f(0) = f(2)$, so $f$ has no inverse.
Making the function one–one
Cut the domain at the turning point. Then the graph only rises (or only falls) and $f$ has an inverse.
Worked example 2. $f(x) = x^2 + 6x + 1$ for $x \geqslant k$. Find the least value of $k$ for which $f$ has an inverse.
- Complete the square: $f(x) = (x + 3)^2 - 8$. The turning point is at $x = -3$.
- For $x \geqslant -3$ the curve only rises, so $f$ is one–one.
- Least $k = -3$.
If $x^2$ has a number in front, take that number out of the $x$ terms first:
Functions that always have an inverse
- A straight line that is not horizontal, such as $f(x) = 3x - 5$: it only rises or only falls.
- $f(x) = e^x$ and $f(x) = \ln x$: they only rise.
A trigonometric example
Worked example 3. $f(x) = \cos x$ for $0 \leqslant x \leqslant 2\pi$. Explain why $f$ has no inverse.
- $\cos x$ goes down from $1$ to $-1$ (at $x = \pi$), then back up to $1$.
- For example $\cos\dfrac{\pi}{3} = \cos\dfrac{5\pi}{3} = \dfrac{1}{2}$.
- So $f$ is many–one and has no inverse. On $0 \leqslant x \leqslant \pi$ alone it only goes down, so there it is one–one.
1.6 Inverse of a one–one function
One method finds every inverse on this syllabus. The exam also expects the correct notation and the domain of the inverse.
The method
To find $f^{-1}(x)$ for a one–one function $f$:
- Write $y = f(x)$.
- Rearrange 变形 to make $x$ the subject 主语.
- Swap the letters: write the answer as $f^{-1}(x) = \ldots$ in terms of $x$.
- State the domain of $f^{-1}$: it is the range of $f$.
The inverse undoes the steps of $f$ in reverse order:

You need two facts to undo $e$ and $\ln$: if $e^a = b$ then $a = \ln b$, and if $\ln a = b$ then $a = e^b$.
Worked example 1. $f(x) = e^{2x} + 1$ for $x \in \mathbb{R}$. Find $f^{-1}(x)$ and state its domain.
- $y = e^{2x} + 1$, so $y - 1 = e^{2x}$.
- Take $\ln$ of both sides: $2x = \ln(y - 1)$, so $x = \frac{1}{2}\ln(y - 1)$.
- $f^{-1}(x) = \frac{1}{2}\ln(x - 1)$.
- $e^{2x} > 0$, so the range of $f$ is $f(x) > 1$. Domain of $f^{-1}$: $x > 1$.
A fraction: collect the $x$ terms
Worked example 2. $f(x) = \dfrac{3x + 1}{x - 2}$ for $x > 2$. Find $f^{-1}(x)$.
- $y = \dfrac{3x + 1}{x - 2}$. Multiply both sides by $(x - 2)$: $y(x - 2) = 3x + 1$.
- Expand: $xy - 2y = 3x + 1$.
- Put the $x$ terms on one side: $xy - 3x = 2y + 1$.
- Factorise: $x(y - 3) = 2y + 1$, so $x = \dfrac{2y + 1}{y - 3}$.
- $f^{-1}(x) = \dfrac{2x + 1}{x - 3}$.
A quadratic on a restricted domain: complete the square first
Worked example 3. $f(x) = x^2 - 4x + 1$ for $x \geqslant 2$. Find $f^{-1}(x)$ and state its domain.
- Complete the square: $y = (x - 2)^2 - 3$.
- $y + 3 = (x - 2)^2$, so $x - 2 = \sqrt{y + 3}$. Take the positive root, because $x \geqslant 2$ means $x - 2 \geqslant 0$.
- $f^{-1}(x) = 2 + \sqrt{x + 3}$.
- Range of $f$: $f(x) \geqslant -3$. Domain of $f^{-1}$: $x \geqslant -3$.
If the form is $a(x - h)^2 + k$, divide by $a$ before taking the square root: $(x - h)^2 = \dfrac{y - k}{a}$. The range of $f^{-1}$ is the domain of $f$.
A logarithm
Worked example 4. $f(x) = \ln(2x + 3)$ for $x > -\frac{3}{2}$. Find $f^{-1}(x)$.
- $y = \ln(2x + 3)$, so $e^y = 2x + 3$.
- $x = \dfrac{e^y - 3}{2}$, so $f^{-1}(x) = \dfrac{e^x - 3}{2}$.
Check any inverse with one number: $f(0) = \ln 3$, and $f^{-1}(\ln 3) = \dfrac{3 - 3}{2} = 0$. ✓
1.7 Form and use composite functions
Composite functions appear in most functions questions: you form one, simplify it, and then solve an equation with it.
Forming a composite function
$fg(x) = f(g(x))$ is a composite function. To form it, put the whole expression $g(x)$, in brackets, in place of every $x$ in $f$. The function nearest to $x$ acts first.
Worked example 1. $f(x) = 3x - 1$ and $g(x) = x^2 + 2$. Find $fg(x)$ and $gf(x)$.
- $fg(x) = f(x^2 + 2) = 3(x^2 + 2) - 1 = 3x^2 + 5$.
- $gf(x) = g(3x - 1) = (3x - 1)^2 + 2 = 9x^2 - 6x + 3$.
- The two answers are different: the order matters.
Solving an equation with a composite function
Form the composite first, then solve as usual.
Worked example 2. With $f$ and $g$ as above, solve $fg(x) = 17$.
- $3x^2 + 5 = 17$, so $3x^2 = 12$ and $x^2 = 4$.
- $x = 2$ or $x = -2$.
$e^x$ and $\ln x$ cancel each other
$e^{\ln a} = a$ for $a > 0$, and $\ln(e^a) = a$. Use this to simplify composites.
Worked example 3. $f(x) = e^x$ for $x \in \mathbb{R}$ and $g(x) = \ln(2x + 1)$ for $x > -\frac{1}{2}$.
- $fg(x) = e^{\ln(2x + 1)} = 2x + 1$.
- Solve $gf(x) = \ln 7$: $\ln(2e^x + 1) = \ln 7$, so $2e^x + 1 = 7$.
- $e^x = 3$, so $x = \ln 3$.
An inverse inside a composite
$f^{-1}$ undoes $f$, so $f^{-1}(a) = b$ means $a = f(b)$. You do not need to find $f^{-1}(x)$ first.
Worked example 4. $f(x) = 2x + 3$ and $g(x) = x^2$. Solve $f^{-1}g(x) = 3$.
- $f^{-1}(g(x)) = 3$, so $g(x) = f(3) = 9$.
- $x^2 = 9$, so $x = 3$ or $x = -3$.
The domain of a composite
$gf$ exists only when every output of $f$ is an allowed input of $g$. So the domain of $gf$ is the set of $x$ for which $f(x)$ lies in the domain of $g$.

The inner oval (the outputs of $f$) must sit inside the shaded oval (the domain of $g$). To explain why a composite does not exist, name an output of the first function that the second function cannot take.
Finding $g$ from $f$ and $fg$
Write $f(g(x))$ in terms of $g(x)$, set it equal to $fg(x)$, and solve for $g(x)$. For example, if $f(x) = 2x + 3$ and $fg(x) = 2x^2 + 7$, then $2g(x) + 3 = 2x^2 + 7$, so $g(x) = x^2 + 2$.
1.8 Sketch graphs of a function and its inverse
The graph of an inverse function costs no new work: it is a mirror image of the graph you already have.
Reflection in the line $y = x$
The inverse function swaps inputs and outputs. So every point $(a, b)$ on $y = f(x)$ becomes the point $(b, a)$ on $y = f^{-1}(x)$.
The graph of $y = f^{-1}(x)$ is the reflection of the graph of $y = f(x)$ in the line $y = x$.

$y = e^x$ and $y = \ln x$ are inverse functions. The dotted segment joins two mirror points: it crosses $y = x$ at a right angle.
What moves where:
| On $y = f(x)$ | On $y = f^{-1}(x)$ |
|---|---|
| $y$-intercept $(0, c)$ | $x$-intercept $(c, 0)$ |
| $x$-intercept $(d, 0)$ | $y$-intercept $(0, d)$ |
| asymptote 渐近线 $y = k$ | asymptote $x = k$ |
To sketch both graphs on one diagram, use equal scales 相同比例尺 on the two axes, draw $y = x$, and reflect the key points first.
Where the two graphs meet
When $f$ is increasing, the graphs of $f$ and $f^{-1}$ can only meet on the line $y = x$. So solve $f(x) = x$.
Worked example 1. $f(x) = 2x + 4$. Find $f^{-1}(x)$ and the point where the graphs of $f$ and $f^{-1}$ meet.
- $y = 2x + 4$, so $x = \dfrac{y - 4}{2}$ and $f^{-1}(x) = \dfrac{x - 4}{2}$.
- Check with a point: $(0, 4)$ is on $y = f(x)$, and $f^{-1}(4) = 0$, so $(4, 0)$ is on $y = f^{-1}(x)$. ✓
- Meet where $f(x) = x$: $2x + 4 = x$, so $x = -4$. The point is $(-4, -4)$.
Explaining the relationship
A 1-mark question asks how the two graphs are related. Write:
One graph is the reflection of the other in the line $y = x$.
Words in the questions
The exercise sheets for this topic also use these words:
- completing the square 配方法
- maps to 映射到
- positive root 正根
- exact completely correct in every detail