A function is a special kind of mapping where every input gives exactly one output. Mastering the language — mapping, function, domain, range — is the foundation of every Functions topic that follows.
📘
What you need to know
A mapping takes inputs and produces outputs — there are 4 types
A function is a mapping where every input has exactly one output (one-to-one or many-to-one)
The vertical line test checks visually: any vertical line crosses the graph at most once
Notation: if x is the input, f(x) is the output
Domain = set of inputs (in x); range = set of outputs (in f(x))
Common number sets: ℕ ⊂ ℤ ⊂ ℚ ⊂ ℝ
Piecewise functions use different rules on different intervals
What is a Mapping?
A mapping is anything that takes a set of inputs and turns them into outputs — like a machine that transforms numbers. There are four types of mappings, but only two of them count as functions:
Function ✓
One-to-One
Each input → one unique output. e.g. cubing:x → x3
Function ✓
Many-to-One
Each input → one output, but outputs can repeat. e.g. squaring:x → x2
Not a Function ✗
One-to-Many
An input → multiple outputs. e.g. ±√x: 4 → ±2
Not a Function ✗
Many-to-Many
Many inputs → many outputs. e.g. factors: 6 → 1, 2, 3, 6
The rule for being a function: each input must produce exactly one output. The outputs can repeat (many-to-one is fine), but an input can never split into multiple outputs.
The Vertical Line Test
Visually, you can check if a graph represents a function by sliding a vertical line across it:
PASSES ✓
A vertical line meets the curve at most once. Function.
FAILS ✗
A vertical line meets the curve twice. Not a function.
Function Notation
Functions are named with letters (most often f, but also g, h, v, etc.). The notation f(x) is read as “f of x” — it’s the output when you put x into f:
f(x) = f(x)
Function name
A label for the rule (f, g, h, …)
Input
The value you put in (the argument)
Output
The value the function spits out
So if f(2) = 5, that just means “when the input is 2, the output is 5”. On a graph, this is the point (2, 5).
Domain and Range
Every function has a domain and a range:
Domain = the set of all inputs the function accepts. Expressed in terms of x (e.g. x ≥ 0).
Range = the set of all outputs the function produces. Expressed in terms of f(x) (e.g. f(x) ≥ 1).
On a graph, the domain runs along the x-axis and the range runs along the y-axis.
If a domain isn’t given, assume the largest possible set of real numbers. For example, x ∈ ℝ — except where the function breaks down (like x = 0 in 1x, or x < 0 in √x).
Sets of Numbers
You’ll see these special symbols when describing domains and ranges:
Number Sets — From Smallest to Largest
ℕNatural Numbers0, 1, 2, 3, …
ℤIntegers…, −2, −1, 0, 1, 2, …
ℚRationals12, −34, 0.25, 7, …
ℝReal Numbersπ, e, √2, all of the above
Each set sits inside the next: ℕ ⊂ ℤ ⊂ ℚ ⊂ ℝ. The symbol ℤ⁺ means positive integers.
Use the symbol ∈ (“is a member of”) to say a value belongs to a set: x ∈ ℝ means “x is any real number”.
Piecewise Functions
A piecewise function uses different rules on different intervals. The intervals can’t overlap, and the function may or may not be continuous at the boundaries:
Example
f(x) =
{x + 1if x ≤ 52x − 4if 5 < x < 10x2if 10 ≤ x ≤ 20
To evaluate, just check which interval the input falls into and use that rule:
f(1) uses the first rule (since 1 ≤ 5): f(1) = 1 + 1 = 2
f(11) uses the third rule (since 10 ≤ 11 ≤ 20): f(11) = 112 = 121
Continuous? Check the boundaries. At x = 5: rule 1 gives 5 + 1 = 6, but rule 2 would give 2(5) − 4 = 6 — they match, so it’s continuous there. At x = 10: rule 2 gives 2(10) − 4 = 16, but rule 3 gives 102 = 100 — they don’t match, so there’s a jump.
Apply the function to the domain bounds. Since cubing preserves order:2 ≤ x ≤ 108 ≤ x³ ≤ 10009 ≤ x³ + 1 ≤ 10019 ≤ f(x) ≤ 1001Range is in terms of f(x), not x.
✎
Example 3 — Identify mapping types
For each mapping, classify the type and state whether it’s a function:
(a) f: x → 2x + 5 (b) f: x → x4 (c) f: x → ±√x
Answer:
(a) 2x + 5: each input → one unique output.One-to-one — function ✓(b) x⁴: x and −x give the same output (e.g. 2 and −2 both give 16).Many-to-one — function ✓(c) ±√x: e.g. 4 → +2 AND −2.One-to-many — NOT a function ✗
✎
Example 4 — Find the largest possible domain
Find the largest possible domain for each function:
(a) f(x) = √(x − 3) (b) g(x) = 1x − 2
Answer:
(a) Square roots need a non-negative input.x − 3 ≥ 0 → x ≥ 3x ≥ 3(b) Fractions can’t have a zero denominator.x − 2 ≠ 0 → x ≠ 2x ∈ ℝ, x ≠ 2Always check for these two restrictions: square roots of negatives, and division by zero.
✎
Example 5 — Piecewise function evaluation
A piecewise function is defined by:
f(x) = { 2x + 1 if x < 3, x2 − 4 if x ≥ 3 }
Find f(0), f(3), and f(5).
Answer:
f(0): since 0 < 3, use the first rule.f(0) = 2(0) + 1 = 1f(0) = 1f(3): since 3 ≥ 3, use the second rule.f(3) = 3² − 4 = 5f(3) = 5f(5): since 5 ≥ 3, use the second rule.f(5) = 5² − 4 = 21f(5) = 21Always check which interval the input belongs to before substituting.
💡
Tips
Sketch the graph when looking for the range. Once you see the shape, the smallest and largest y-values are obvious.
Domain in x, range in f(x). A common mark-loser is mixing the variables. Domain talks about input; range talks about output.
Check restrictions when finding the largest domain: no square roots of negatives, no division by zero, no logs of zero or negatives.
Use the GDC to plot a function quickly — the visual confirms domain, range, and whether it passes the vertical line test.
For piecewise functions, always identify the interval first, then apply the matching rule. Don’t try to combine pieces.
⚠
Common mistakes
Confusing domain and range. Domain = inputs (x). Range = outputs (f(x)). Mixing the two is the #1 mistake here.
Calling ±√x a function. One input gives two outputs → this is one-to-many, NOT a function. The single value √x (positive root only) IS a function.
Forgetting f(x) is not the same as f times x. The brackets here mean “evaluated at,” not multiplication.
Forgetting domain restrictions. If you say “f(x) = √x on all reals,” you’ve made a mistake — square roots need x ≥ 0.
Mismatched piecewise intervals. Make sure the intervals don’t overlap and there are no gaps. x ≤ 3 and x ≥ 3 both contain 3 (problem!) — use x < 3 and x ≥ 3.
Range expressed in terms of x instead of f(x). Writing “range: 0 ≤ x ≤ 5″ loses marks — should be “0 ≤ f(x) ≤ 5″.
Final word: Functions are mappings where each input gets exactly one output. Get that straight and the rest — domain, range, notation, piecewise — all click into place.
Need help with Functions?
Get 1-on-1 help from an IB examiner who knows exactly what Paper 1 & 2 are looking for.