Note: $f: X \to Y$ means that the function $f$ has domain $X$ and codomain $Y$. The codomain of a function contains its range (all possible values that the function can output), but the codomain can also be larger than the range.

injective functions

A function $f: X \to Y$ is injective if $f(a) = f(b)$ implies $a=b$. In other words, a function is injective if no two inputs (i.e. $x$-values) correspond to the same output (i.e. $y$-value).

surjective functions

A function $f: X \to Y$ is surjective if for every $y \in Y$, there is at least one $x$ such that $f(x) = y$. In other words, a function is surjective if its codomain is the same as its range (i.e. the function can output every possible value in its codomain).