Concepts: functions, composition and invertible functions: Relations and Functions
Relations and Functions24 min readLesson 3 of 5
3.1 What makes a map a function
A function f : X → Y assigns exactly one element f(x) of Y to every x in X. Two things can go wrong. A rule that leaves an element of X without an image is not a function on X. A rule that gives one element of X two different images is also not a function. The vertical line test catches both: a curve is the graph of a function only when every vertical line meets it at most once.
A function may send different inputs to the same output. That is allowed. What is not allowed is one input with two outputs.
3.1.1 One-one (injective)
A function is one-one when different inputs always produce different outputs. The formal test starts with f(x1) = f(x2) and ends with x1 = x2. For f(x) = 2x on the real numbers, f(x1) = f(x2) gives 2x1 = 2x2 and then x1 = x2, so the function is one-one. For f(x) = x² on the whole real line, f(2) = f(-2) = 4, so two different inputs share an output and the function is not one-one. Restrict the domain to [0, infinity) and the same formula becomes one-one, which shows that the domain is part of the definition.
3.1.2 Onto (surjective)
A function is onto when its range equals its codomain. To prove onto for f : X → Y, take a general y in Y and solve y = f(x) for x in X. For f(x) = 2x with X = Y = the real numbers, x = y/2 is always available, so the map is onto. For f(x) = x² with X = Y = the real numbers, the equation y = x² has no real solution when y is negative, so the map is not onto. Change the codomain to [0, infinity) and the same formula becomes onto.
A one-one and onto function is called bijective. Only bijections can be inverted, and only a bijection lets you go back from every output to its input.
Slideshow, slide 1 of 3. Use the left and right arrow keys to change slides and the space bar to play or pause.

Four arrow diagrams comparing maps f1, f2, f3 and f4 between sets of numbers and letters
3.2 Composition of functions
Functions chain. If f maps A into B and g maps B into C, then applying f first and g second gives the composition gof from A to C. The formula reads gof(x) = g(f(x)). The order matters. For f(x) = x + 1 and g(x) = x², gof(x) = (x + 1)² while fog(x) = x² + 1, and these are different functions.
The composition is defined only when the range of the first function fits inside the domain of the second. Two useful facts follow quickly: composition is associative, so (hog)of = ho(gof) whenever all the pieces are defined, and the identity function behaves as a neutral element, with f o I = I o f = f on the matching domain.
Composition also keeps injectivity and surjectivity when both parts have them. If f and g are one-one then gof is one-one, and a similar statement holds for onto functions. The converses fail in general.
3.3 Invertible functions
A function f : X → Y is invertible when there is a function g : Y → X with gof equal to the identity on X and fog equal to the identity on Y. Then g is the inverse of f and is written f⁻¹. The existence of the inverse is equivalent to f being bijective: one-one gives the reverse rule a unique answer for each output, and onto makes sure every element of Y is covered.
The graph picture is worth remembering. The graphs of y = f(x) and y = f⁻¹(x) are mirror images in the line y = x, because the inverse swaps the coordinates of every point.
3.3.1 Worked example
Let f : R → R be f(x) = 3x + 2. First show it is one-one: f(x1) = f(x2) gives 3x1 + 2 = 3x2 + 2, so x1 = x2. Next show it is onto: given y in R, take x = (y - 2)/3, and substitution gives f(x) = y. So f is a bijection. For the inverse, start from y = 3x + 2 and swap roles: x = (y - 2)/3, hence f⁻¹(y) = (y - 2)/3. A quick check returns f(f⁻¹(y)) = y and f⁻¹(f(x)) = x.
3.3.2 How to write the proof in the exam
For one-one, begin from f(a) = f(b) and reach a = b. For onto, take y in the codomain, construct x, and show the image equals y. For the inverse, derive the formula after proving the function is bijective. Each step earns its own mark, so do not merge the three.
A useful check before writing the inverse: test two values. If f(1) = 5 and f(2) = 8 for f(x) = 3x + 2, then the inverse should send 5 back to 1 and 8 back to 2. Substituting into the formula catches sign slips early. For rational functions, also state the values the inverse cannot take, because those are the points where the original denominator was zero.
When the domain is an interval, such as f : [0, infinity) to [0, infinity) with f(x) = x squared, the proof of onto must show that the constructed square root stays inside the domain. That extra sentence is what separates a full mark answer from a half mark answer.

Warning
A relation is not a function just because it has a formula. Check the domain: every input must have exactly one image. The data set question on a relation and its domain, range and function status is a common one mark item.


