A function is a rule that assigns to each element in one set exactly one element in another set.
Functions are central to the DSE Mathematics compulsory syllabus and underpin topics including
polynomials), logarithms,
sequences), and inequalities).
A function f from a set A to a set B, written f:A→B, is a rule that assigns to
every element x∈Aexactly one element y∈B. The element y is called the image
of x under f, written y=f(x).
The set A is called the domain of f.
The set B is called the codomain of f.
The set of all images {f(x):x∈A} is called the range of f. The range is always a
subset of the codomain: range(f)⊆B.
A relation is any subset of A×B. A function is a special type of relation where each
element of A appears as the first component of exactly one ordered pair.
A mapping diagram represents a function by drawing arrows from each element of the domain to the
corresponding element(s) in the codomain. For a valid function, every element in the domain must
have exactly one arrow leaving it.
For a graph in the xy-plane, the vertical line test states that a curve represents a function
of x if and only if no vertical line intersects the curve more than once.
Injective (one-to-one) if f(x1)=f(x2)⟹x1=x2. Equivalently, distinct inputs
produce distinct outputs. This can be checked using the horizontal line test: no horizontal
line intersects the graph more than once.
Surjective (onto) if for every y∈B, there exists x∈A such that f(x)=y. In
other words, the range equals the codomain.
Bijective (one-to-one correspondence) if f is both injective and surjective.
Examples
f(x)=2x+1 with domain ′{′R′}′ is injective (linear, non-constant) and surjective onto ′{′R′}′, hence bijective.
f(x)=x2 with domain ′{′R′}′ is neither injective (f(2)=f(−2)=4) nor surjective onto ′{′R′}′ (range is [0,∞)).
f(x)=x2 with domain [0,∞) and codomain [0,∞) is bijective.
f(x)=x1 with domain ′{′R′}′∖{0} is injective but not surjective onto ′{′R′}′ (range is ′{′R′}′∖{0}).
The graphs of y=f(x) and y=f−1(x) are reflections of each other in the line y=x.
To find f−1(x), set y=f(x), solve for x in terms of y, then interchange x and y.
A necessary condition for a function to have an inverse is that it is one-to-one (injective). If the
original function is not injective on its given domain, one may restrict the domain to make it
injective.
Examples
Let f(x)=2x+3 and g(x)=x2. Then:
(f∘g)(x)=f(g(x))=f(x2)=2x2+3
(g∘f)(x)=g(f(x))=g(2x+3)=(2x+3)2=4x2+12x+9
Note that (f∘g)(1)=5 but (g∘f)(1)=25, confirming f∘g=g∘f.
Find the inverse of f(x)=x−32x+1 (x=3):
Set y=x−32x+1
y(x−3)=2x+1⟹yx−3y=2x+1
x(y−2)=3y+1⟹x=y−23y+1
Therefore f−1(x)=x−23x+1, with domain ′{′R′}′∖{2}.
Let f(x)=x−1 and g(x)=x2+1. Find the domain of f∘g:
dom(g)=′{′R′}′
dom(f)={x:x≥1}, so we require g(x)≥1, i.e.
x2+1≥1⟹x2≥0, which holds for all real x.
For a>1: f(x)=ax is strictly increasing. The graph passes through (0,1), approaches
the x-axis as x→−∞ (horizontal asymptote at y=0), and rises steeply as
x→∞.
For 0<a<1: f(x)=ax is strictly decreasing. The graph is a reflection of
y=(a1)x in the y-axis.
Given the graph of y=f(x), the graph of y=af(x+b)+c is obtained by applying a sequence
of transformations. The general form can be broken down as:
y=a⋅f(x−(−b))+c
Graph Transformations
Use the sliders to explore how the parameters a, b, and c transform the parent function, and
observe the order in which each transformation is applied.
For y=af(x+b)+c, the recommended order of application (from the graph of y=f(x)) is:
Horizontal translation by −b units (shift left if b>0, right if b<0): replace x
with x+b.
Vertical stretch/compression (and possible x-axis reflection) by factor ∣a∣: multiply the
function by a.
Vertical translation by c units: add c.
Alternatively, one may think of this as working from the "inside out": apply the horizontal shift
first, then the vertical scaling, then the vertical shift.
info
Horizontal transformations operate on xbefore the function is evaluated; vertical
transformations operate on f(x)after the function is evaluated. This is why the horizontal
shift has the "opposite sign" effect: f(x+b) shifts left by b (not right).
Examples
Describe the transformation from y=x2 to y=2(x−3)2+1:
Starting from y=x2:
Shift right by 3 units: y=(x−3)2
Vertical stretch by factor 2: y=2(x−3)2
Shift up by 1 unit: y=2(x−3)2+1
The vertex moves from (0,0) to (3,1).
The graph of y=f(x) passes through (2,5). Find the corresponding point on y=−f(2x)+3:
Start with (2,5) on y=f(x), meaning f(2)=5.
For y=−f(2x)+3, set 2x=2⟹x=1.
Then y=−f(2)+3=−5+3=−2.
The point is (1,−2).
Given f(x)=x, sketch y=−x+4−2:
Rewrite as y=f(−(x−4))−2=f(−x+4)−2.
From y=x: reflect in the y-axis to get y=−x, then shift right by 4 to
get y=−(x−4)=−x+4, then shift down by 2.
y=∣f(x)∣: Reflect any part of the graph of y=f(x) that lies below the x-axis above
it. The portion above the axis remains unchanged.
y=f(∣x∣): The graph for x≥0 is the same as y=f(x). The graph for x<0 is
the reflection of the x≥0 portion in the y-axis (i.e., f(∣x∣) is always an even
function).
Examples
Solve ∣2x−3∣=7:
2x−3=7⟹x=5, or 2x−3=−7⟹x=−2.
Solutions: x=−2 or x=5.
Solve ∣3x+1∣<5:
−5<3x+1<5⟹−6<3x<4⟹−2<x<34.
Solution: x∈(−2,34).
Solve ∣x2−5x∣≥6:
Case 1:
x2−5x≥6⟹x2−5x−6≥0⟹(x−6)(x+1)≥0⟹x≤−1
or x≥6.
Case 2:
x2−5x≤−6⟹x2−5x+6≤0⟹(x−2)(x−3)≤0⟹2≤x≤3.
Solution: x≤−1 or 2≤x≤3 or x≥6.
Sketch y=∣x2−4x−5∣:
Factor: y=∣(x−5)(x+1)∣.
The quadratic x2−4x−5 has roots at x=−1 and x=5, with vertex at x=2 giving
f(2)=4−8−5=−9.
Below the x-axis on (−1,5); above on (−∞,−1]∪[5,∞).
Reflect the portion on (−1,5) upward. The minimum on (−1,5) becomes a maximum at (2,9).
Express both sides with a common denominator so one side is zero.
Factor numerator and denominator completely.
Draw a sign chart: identify all critical points (zeros of numerator and denominator) and test
the sign of the expression in each interval.
Exclude values where the denominator is zero (even for ≥ or ≤).
warning
Critical pitfall: When multiplying both sides of an inequality by an expression
involving x, the direction of the inequality flips if that expression is negative. Instead of
multiplying through, use a sign chart.
Examples
Solve x2−3x−4≤0:
x2−3x−4=(x−4)(x+1).
Roots: x=−1 and x=4. Parabola opens upward.
f(x)≤0 between the roots: −1≤x≤4.
Solve x+2x−1>0:
Critical points: x=1 (numerator zero) and x=−2 (denominator zero, excluded).
For a vertical asymptote at x=a, the sign of f(x) on each side depends on the signs of the
remaining factors. Analyse using a sign chart or by evaluating test points on each side.
For the equation f(x)=k (where k is a constant), the number of solutions equals the number of
times the horizontal line y=k intersects the graph of y=f(x).
Key observations:
At a local maximum or minimum of f, a small change in k can change the number of
solutions.
If k equals the maximum or minimum value, the corresponding intersection point is a tangency
(double root).
Forgetting both cases. When solving ∣f(x)∣=a, you must consider f(x)=a AND
f(x)=−a. Dropping one case loses solutions.
Wrong inequality direction.∥f(x)∥<a means f(x) is between−a and a (a single
interval). ∥f(x)∥>a means f(x) is outside this range (two disjoint intervals).
Confusing these produces wrong solution sets.
Squaring both sides carelessly. Squaring ∣f(x)∣=∣g(x)∣ to get f(x)2=g(x)2 is valid,
but squaring f(x)=g(x) can introduce extraneous solutions (e.g., x=x squares to
x2=x, giving x=0 or x=1, but x=1 is extraneous).
Rational function errors
Cancelling factors blindly.x−2x2−4=x+2 only for x=2. The point
x=2 is a hole, not a point on the graph.
Confusing holes and asymptotes. If a factor cancels from both numerator and denominator, the
result is a hole (removable discontinuity), not a vertical asymptote.
Wrong horizontal asymptote. The horizontal asymptote depends on the leading terms only. Do
not set the entire numerator equal to the entire denominator.
Inequality errors
Multiplying by a variable. Multiplying g(x)f(x)>0 by g(x) flips the
inequality when g(x)<0. Always use a sign chart instead.
Including excluded values. For g(x)f(x)≥0, values where g(x)=0 are still
excluded from the domain, even though the inequality is non-strict.
Wrong discriminant analysis. A negative discriminant with a>0 means the quadratic is
always positive, not always negative.
Let u=3x (note u>0). The equation becomes u2−10u+9=0.
(u−1)(u−9)=0⟹u=1 or u=9.
Case 1: 3x=1⟹x=0.
Case 2: 3x=9=32⟹x=2.
Solutions: x=0 or x=2.
Question: Solve log3(x−2)+log3(x+6)=2.
Answer
Product law: log3[(x−2)(x+6)]=2.
Convert: (x−2)(x+6)=32=9.
x2+4x−12=9⟹x2+4x−21=0.
(x+7)(x−3)=0⟹x=−7 or x=3.
Domain: x−2>0⟹x>2. Therefore x=−7 is rejected.
Solution: x=3.
Question: The graph of y=f(x) passes through the points (1,4) and (3,10). State the
coordinates of the corresponding points on the graph of y=2f(x−1)+3.
Answer
For a point (a,b) on y=f(x) (so f(a)=b), the corresponding point on y=2f(x−1)+3
is found by setting x−1=a, i.e. x=a+1, and y=2b+3.
(1,4)↦(1+1,2×4+3)=(2,11).
(3,10)↦(3+1,2×10+3)=(4,23).
Question: Given f(x)=log2(x+3) and g(x)=2x−1, show that f and g are
inverse functions of each other, and state the domain and range of f−1.
Wait -- let us verify properly. g(x)=2x−1, so
f(g(x))=log2(2x−1+3)=log2(2x+2). This does not simplify to x directly.
Let us re-examine. For f and g to be inverses, we need f(g(x))=x.
f(g(x))=log2(2x+2)=x in general. Let us check: at x=0,
f(g(0))=log2(1+2)=log23=0.
These are not inverse functions. (This is a trick question designed to test careful
verification.)
To find the true inverse of f(x)=log2(x+3):
Set y=log2(x+3)⟹2y=x+3⟹x=2y−3.
f−1(x)=2x−3.
dom(f−1)=range(f)=′{′R′}′ (since log2(x+3) takes all real
values for x>−3).
range(f−1)=dom(f)=(−3,∞).
Question: Given f(x)=x2+2x−3, find the range of f when (a) the domain is
′{′R′}′, and (b) the domain is [0,4].
Answer
Completing the square: f(x)=(x2+2x+1)−1−3=(x+1)2−4.
The vertex is at (−1,−4).
(a) Domain ′{′R′}′: Since the parabola opens upward with minimum −4, range is
[−4,∞).
(b) Domain [0,4]:
f(0)=−3, f(4)=16+8−3=21.
On [0,4], the function is increasing (vertex at x=−1 is to the left of the interval).
Range: [−3,21].
Question: Let f(x)=x−2x for x=2. Find f−1, and evaluate
f−1(3)+f(3).
Answer
Set y=x−2x.
y(x−2)=x⟹yx−2y=x⟹yx−x=2y⟹x(y−1)=2y⟹x=y−12y.
f−1(x)=x−12x, with domain ′{′R′}′∖{1}.
f−1(3)=3−12(3)=3.
f(3)=3−23=3.
f−1(3)+f(3)=3+3=6.
For the A-Level treatment of this topic, see Functions.
tip
Diagnostic Test
Ready to test your understanding of Functions? The diagnostic test contains the hardest questions within the DSE specification for this topic, each with a full worked solution.
Unit tests probe edge cases and common misconceptions. Integration tests combine Functions with other DSE mathematics topics to test synthesis under exam conditions.
See Diagnostic Guide for instructions on self-marking and building a personal test matrix.
DSE Practice 1. Let f(x)=x−12x+3. Find the domain, range, and determine whether f is injective.
Solution
Domain: x=1, so dom(f)=′{′R′}′∖{1}.
f(x)=2+x−15.
For x>1: as x→1+, f(x)→+∞; as x→+∞, f(x)→2+. Range: (2,+∞).
For x<1: as x→1−, f(x)→−∞; as x→−∞, f(x)→2−. Range: (−∞,2).
Combined range: ′{′R′}′∖{2}.
f is injective: for x>1, f is strictly decreasing (derivative −5/(x−1)2<0); for x<1, f is also strictly decreasing. And no value from (2,+∞) overlaps with (−∞,2).
DSE Practice 2. Let f(x)=x2−2x+3 for x≥1. Find the range and determine whether f has an inverse.
Solution
f(x)=(x−1)2+2. Since x≥1 and the vertex is at (1,2), f is strictly increasing on [1,∞).
Range: [2,∞).
Since f is strictly increasing (hence injective) on [1,∞), it has an inverse.
DSE Practice 3. A function is defined by f(x)=⌊x⌋ (the greatest integer less than or equal to x). Find f(3.7), f(−2.1), and f(0).
Solution
f(3.7)=3, f(−2.1)=−3, f(0)=0.
DSE Practice 4. Determine whether f(x)=x3+x is odd, even, or neither.
Solution
f(−x)=(−x)3+(−x)=−x3−x=−(x3+x)=−f(x)
Since f(−x)=−f(x), f is odd.
DSE Practice 5. The function f is defined on ′{′R′}′ by f(x)=ax2+bx+c. Given that f(0)=5, f(1)=4, and f(−1)=10, find a, b, and c.