Functions: a guide for university exams

A function is a precise rule between sets. A solid understanding of domains, codomains and ranges makes it much easier to recognize injectivity, surjectivity, inverses and compositions.

Formal definition

Function

A function f:Aβ†’B assigns to every element x∈A exactly one element f(x)∈B.

Notation

x↦f(x) describes the rule; f:Aβ†’B also specifies the sets involved.

Fundamental rule

The same input cannot have two different outputs. Distinct inputs may have the same output; that does not prevent the relation from being a function.

A function is more than a formula. Its definition requires a domain, codomain and assignment rule. The same formula can have different properties with different codomains.
ObjectMeaningExample for f: ℝ β†’ ℝ, f(x) = xΒ²
ADomain: the set of allowed inputs.ℝ
BCodomain: the declared set of possible outputs.ℝ
f(x)Image of the element x.f(βˆ’3) = 9
f(A)Range of the function: the values it actually takes.[0, +∞)
f⁻¹({y})Fiber or preimage of y: the inputs that produce y.f⁻¹({9}) = {βˆ’3, 3}

Domain, codomain, range and preimage

For f:Aβ†’B and subsets SβŠ†A, TβŠ†B:

Image of a set

f(S)={f(x):x∈S}

Preimage

fβˆ’1(T)={x∈A:f(x)∈T}
The notation f⁻¹(T) for a preimage is meaningful even when f is not invertible. Do not confuse it with the inverse function, which exists only when f is bijective.

How to find the natural domain of a real formula

Expression containsConditionExample
DenominatorIt must be nonzero.1/(xβˆ’2): x β‰  2
Even-index rootThe radicand must be β‰₯ 0.√(3βˆ’x): x ≀ 3
LogarithmThe argument must be > 0.log(x+1): x > βˆ’1
Arcsine or arccosineThe argument must lie in [βˆ’1, 1].arcsin(2x): |x| ≀ 1/2
Compositionx must lie in the inner domain and its output in the outer domain.log(√xβˆ’1): x > 1

Ways to represent a function

  • Formula: for example f(x)=x2+1.
  • Arrow diagram: useful for finite sets and for seeing fibers at a glance.
  • Table: lists input-output pairs; it must contain only one output for each input.
  • Cartesian graph: is the set {(x,f(x)):x∈A}.
  • Piecewise definition: different rules on different parts of the domain; always check the junction points.
Vertical line test: a subset of the plane is the graph of a function of x if every vertical line meets it at most once.

Injective, surjective and bijective at a glance

In the diagrams, every arrow starts in the domain A and ends in the codomain B. Check whether two arrows share an endpoint and whether any codomain points remain unreached.

Injective but not surjective Three distinct elements of A reach three distinct elements of B; a fourth element of B is not reached. A B
Injective, not surjective All endpoints are distinct, but one element of B remains unreached.
Surjective but not injective All three elements of B are reached, but two distinct elements of A reach the same element of B. A B
Surjective, not injective All of B is reached, but two elements of A share an endpoint.
Bijective function Each element of A reaches a distinct element of B, and every element of B is reached. A B
Bijective Each element of B is reached exactly once.
domain element reached element unreached element or shared endpoint

Injective function

A function is injective when different inputs produce different outputs.

f(x1)=f(x2) β‡’x1=x2

Equivalently, x1β‰ x2β‡’f(x1)β‰ f(x2).

Algebraic method

Set f(x1)=f(x2) and prove that necessarily x1=x2.

Graphical method

Every horizontal line must meet the graph at most once.

Monotonicity criterion

A function that is strictly increasing or strictly decreasing throughout its domain is injective.

How to disprove it

It is enough to find x1β‰ x2 with the same image.

Example: f:ℝ→ℝ,f(x)=x2 is not injective because f(1)=f(βˆ’1). Its restriction to [0,+∞) is injective.

Surjective function

A function f:A→B is surjective if every element of the codomain is reached:

βˆ€y∈B, βˆƒx∈A: f(x)=y

In other words, f(A)=B.

Direct method

Take an arbitrary y∈B, solve f(x)=y for x and check that at least one solution belongs to the domain.

How to disprove it

Exhibit an element of the codomain that is not the image of any domain element.

It depends on the codomain

x2 from ℝ to ℝ is not surjective; from ℝ to [0,+∞) it is.

Bijectivity and inverse functions

A function is bijective if it is both injective and surjective. Every codomain element has exactly one preimage.

Inverse

If f is bijective, there is an fβˆ’1:Bβ†’A that maps every output back to its unique input.

Fundamental identities

fβˆ’1∘f=idA and f∘fβˆ’1=idB.

Graph

The inverse graph is obtained by reflecting the graph of f across the line y=x.

How to find an inverse

  1. Check that the function is bijective on the stated sets.
  2. Write y=f(x).
  3. Solve the equation for x.
  4. Swap the names x and y, then state the inverse’s domain and codomain.
  5. Check both compositions.
Do not confuse fβˆ’1(x) with 1f(x): the inverse β€œundoes” f, while the reciprocal inverts its value.

Composition of functions

If f:A→B and g:B→C, their composition is:

g∘f:Aβ†’C, (g∘f)(x) =g(f(x))
Composition of two functions An element x of A is sent by f to f(x) in B; g then sends it to g(f(x)) in C. A dashed arrow shows the overall action of g composed with f. A B C x f(x) g(f(x)) f g g ∘ f
Composition: apply f first and then g; the dashed arrow directly represents g ∘ f.
  • Apply the function closest to x first: in g∘f, first f and then g.
  • Composition is generally not commutative: g∘fβ‰ f∘g.
  • It is associative: h∘(g∘f)=(h∘g)∘f.
  • If f and g are injective, then g∘f is injective.
  • If f and g are surjective, then g∘f is surjective.
  • If g∘f is injective, then f is injective. If it is surjective, then g is surjective.
  • For bijective functions, (g∘f)βˆ’1=fβˆ’1∘gβˆ’1.

Restrictions, extensions and identities

Restriction

If SβŠ†A, the restriction fS:Sβ†’B uses the same rule as f on a smaller domain.

Extension

A function g is an extension of f if it agrees with f on f’s domain but is defined on a larger set.

Identity function

idA(x)=x. It is bijective and does not change a function when composed with it.

Constant function

f(x)=c. If the domain has more than one element, it is not injective; it is surjective only onto the codomain {c}.

Important properties of real functions

PropertyDefinition or criterionRemark
Evenf(βˆ’x) = f(x)Graph symmetric about the y-axis.
Oddf(βˆ’x) = βˆ’f(x)Graph symmetric about the origin.
Periodicf(x + T) = f(x) for some T > 0The smallest positive T, if it exists, is the fundamental period.
Increasingx₁ < xβ‚‚ β‡’ f(x₁) ≀ f(xβ‚‚)β€œStrictly increasing” also uses < between the images.
Decreasingx₁ < xβ‚‚ β‡’ f(x₁) β‰₯ f(xβ‚‚)A strictly monotone function is injective.
Bounded aboveThere is an M such that f(x) ≀ M for every x.The least upper bound is the supremum of the range.
Bounded belowThere is an m such that m ≀ f(x) for every x.The greatest lower bound is the infimum of the range.
MaximumThere is an xβ‚€ such that f(x) ≀ f(xβ‚€) for every x.The supremum need not be attained.
Continuous at x₀lim x→x₀ f(x) = f(x₀)This requires f(x₀) to be defined and equal to the limit.
Differentiable at xβ‚€The difference quotient has a finite limit.Differentiability implies continuity; the converse is false.
Useful theorem: a continuous, strictly monotone function on an interval is invertible onto its range; its inverse is continuous and strictly monotone in the same direction.

Elementary graph transformations

New functionEffect on the graph of y = f(x)
f(x) + kVertical translation by k: upward if k > 0.
f(x βˆ’ h)Horizontal translation by h: to the right if h > 0.
a f(x)Vertical scaling by |a|; if a < 0, also reflection across the x-axis.
f(bx)Horizontal scaling by 1/|b|; if b < 0, also reflection across the y-axis.
|f(x)|The parts below the x-axis are reflected above it.
f(|x|)The part for x β‰₯ 0 is reflected across the y-axis.
βˆ’f(x)Reflection across the x-axis.
f(βˆ’x)Reflection across the y-axis.

Checklist for analyzing a real function

  1. Domain and possible symmetries.
  2. Axis intercepts and sign analysis.
  3. Limits at the domain boundaries and asymptotes.
  4. Continuity and classification of discontinuities.
  5. First derivative: critical points, monotonicity, maxima and minima.
  6. Second derivative: concavity and inflection points.
  7. Range of the function, using the limits and extrema found.
  8. Qualitative graph consistent with all the information.
Always determine the domain before differentiating. A formally correct calculation outside the domain does not describe the function.

Worked examples

1. Affine function

f:ℝ→ℝ,f(x)=3xβˆ’2.

Solution

It is strictly increasing and therefore injective. For every y, the equation y = 3x βˆ’ 2 gives x = (y + 2)/3 ∈ ℝ, so it is surjective and hence bijective.

fβˆ’1(y)=y+23.

2. Parabola and codomain

f:ℝ→ℝ,f(x)=x2+1.

Solution

It is not injective because f(x) = f(βˆ’x). Its range is [1, +∞), so it is not surjective onto ℝ.

Restricted to [0, +∞) with codomain [1, +∞), it becomes bijective, with inverse yβˆ’1.

3. Rational function

f(x)=xβˆ’1x+2.

Solution

The domain is ℝ \ {βˆ’2}. Solving y = (xβˆ’1)/(x+2) gives x = (βˆ’1βˆ’2y)/(yβˆ’1), which is possible for y β‰  1.

As a function from ℝ \ {βˆ’2} to ℝ \ {1}, it is bijective. Its inverse is fβˆ’1(y)=βˆ’1βˆ’2yyβˆ’1.

4. Composition and domain

f(x) = √x and g(x) = x βˆ’ 1.

Solution

(f ∘ g)(x) = √(xβˆ’1) has domain [1, +∞).

(g ∘ f)(x) = √xβˆ’1 has domain [0, +∞). The two compositions are different.

Common exam mistakes

  • Calling a function surjective without specifying its codomain.
  • Confusing codomain and range: the range is a subset of the codomain.
  • Testing injectivity with favorable examples: proving it requires a general argument, while one counterexample disproves it.
  • Solving f(x) = y without checking that the solution belongs to the domain.
  • Writing an inverse for a non-bijective function without restricting its domain or codomain.
  • Confusing f⁻¹ with 1/f.
  • Reversing the order of composition: (g ∘ f)(x) = g(f(x)).
  • Forgetting domain restrictions after a composition.
  • Using β€œincreasing” and β€œstrictly increasing” as synonyms.
  • Believing that continuity implies differentiability or that a supremum is always a maximum.

Review exercises

Injectivity and surjectivity

Analyze f:ℝ→ℝ,f(x)=x3βˆ’1.

Answer

It is strictly increasing with range ℝ, so it is bijective. Its inverse is βˆ›(y+1).

Domain of a composition

Find the domain of f(x) = log((xβˆ’1)/(x+2)).

Answer

We need (xβˆ’1)/(x+2) > 0. A sign analysis gives (βˆ’βˆž, βˆ’2) βˆͺ (1, +∞).

Inverse after restriction

Make f(x) = (xβˆ’2)Β² invertible and find an inverse.

Answer

One choice is f: [2,+∞) β†’ [0,+∞). Then f⁻¹(y) = 2 + √y. Choosing the branch x ≀ 2 instead gives 2 βˆ’ √y.

A deduction about composition

If g ∘ f is bijective, what can you conclude about f and g?

Answer

You can conclude that f is injective and g is surjective. Without further assumptions, you cannot conclude that both are bijective.

Practical advice: when you start an exercise, write down the domain and codomain immediately. Almost every later property depends on those two sets.