Functions Reference

Functions: One-to-One, Onto, and Inverse

A function assigns exactly one output to each input; domain, codomain, and rule determine whether it is one-to-one or onto.

Solved Examples

Jump directly to a worked example by type.

Fact Table

IdeaMeaningUse or Check
Function Every input in the domain has exactly one output. Different inputs may share the same output.
Domain and codomain The domain is the set of inputs; the codomain is the declared target set. A function must assign each domain element an output in the codomain.
Range The set of outputs the function actually produces. The range is always a subset of the codomain.
Injective Different inputs have different outputs. Equal outputs force equal inputs.
Surjective Every element of the codomain is reached. The codomain affects this classification.
Bijection A function that is both injective and surjective. A bijection has an inverse function.

Content Formulas

Injective
$$f(a)=f(b)\Rightarrow a=b$$
Surjective
$$\forall y\in\text{codomain},\ \exists x\in\text{domain}:f(x)=y$$
Inverse
$$f^{-1}(f(x))=x,\quad f(f^{-1}(y))=y$$
To test a function, use the declared domain and codomain. The rule alone does not determine whether the function is onto.

Classic Examples

Classify an Integer Function

Classify $f:\mathbb Z\to\mathbb Z$ given by $f(n)=2n$.

Solution Steps
  1. For injectivity, equate two outputs and solve.
  2. For surjectivity, ask whether every integer has a preimage.
$$2a=2b\Rightarrow a=b\quad\text{so }f\text{ is injective.}$$ Every output is even, so an odd integer such as 1 has no preimage. Thus $f$ is not surjective and is not a bijection.

Test a Squaring Function

Is $g:\mathbb R\to\mathbb R$ defined by $g(x)=x^2$ injective or surjective?

Solution Steps
  1. Compare inputs with the same square.
  2. Check whether a negative real number is an output.
$$g(2)=4=g(-2)\quad\text{with }2\ne-2$$ So $g$ is not injective. No negative real number is a square, so $g$ is not surjective onto $\mathbb R$.

Find the Inverse of a Bijection

Find the inverse of $h:\mathbb Z\to\mathbb Z$ defined by $h(n)=n+3$.

Solution Steps
  1. Write $y=n+3$.
  2. Solve for the input $n$ in terms of $y$.
$$y=n+3\quad\Longrightarrow\quad n=y-3$$ $$h^{-1}(y)=y-3$$ Every integer output corresponds to exactly one integer input, so $h$ is bijective.