Functions
Evangelos A. Nikitopoulos
Math 419, Fall 2025
Throughout this note, let X and Y be sets. In other words, X and Y are each
(abstract) collections of things. For example, we could have X = Rn and Y = {1},
or we could have X = {1, 2, 3} and Y = {□, △}.
A function, f , from X to Y is an assignment of exactly one element of Y to
each element of X. In other words, to be a function, f must assign to each x ∈ X an
element of Y , written f (x). We use the symbols f : X → Y to express the statement
that f is a function from X to Y . If f : X → Y , x ∈ X, and y ∈ Y , we write
f
x 7−→ y
to express the statement that y = f (x), i.e., that f “maps x to y.” Also, if f : X → Y ,
we call X the domain of f , Y the codomain or target space of f , and the set
f (X) := {f (x) : x ∈ X}
the range or image of f .
Example. Suppose X is a set consisting of four elements, written x1 , x2 , x3 , and x4 ,
and Y is a set consisting of five elements, written y1 , y2 , y3 , y4 , and y5 . Put another
way, X = {x1 , x2 , x3 , x4 }, and Y = {y1 , y2 , y3 , y4 , y5 }. Below is a picture of a function,
f , from X to Y .
X f Y
- e
X O
2
o
,
-
·
-
X2
n
&
Xzo
X po
Y5
·
1
In words, f maps x1 to y5 , x2 to y1 , and both x3 and x4 to y2 .1 The domain of
f is X = {x1 , x2 , x3 , x4 }, the codomain is Y = {y1 , y2 , y3 , y4 , y5 }, and the range is
f (X) = {y1 , y2 , y5 }. Note that y3 and y4 are in the codomain but not the range of f .
Below are two other expressions of the definition of f .
f
f (x1 ) = y5 x1 7−→ y5
f
f (x2 ) = y1 x2 7−→ y1
f
f (x3 ) = y2 x3 7−→ y2
f
f (x4 ) = y2 x4 7−→ y2
In each row above, the symbols on the right express the equation on the left.
Non-example. Let X and Y be as in the example above.
X Y
- e
X O
2
o
,
-
·
-
X2
n
&
Xzo
X po -
Y5
O
The picture above does not depict a function from X to Y because x4 is assigned two
different elements of Y .
Now, let Z be another set. Also, let f : X → Y and g : Y → Z; in words, let f be
a function from X to Y and g be a function from Y to Z. For each x ∈ X, define
(g ◦ f )(x) := g(f (x)) ∈ Z.
This definition makes sense because f (x) ∈ Y , and Y is the domain of g. Therefore,
it makes sense to plug f (x) into g. With this definition, g ◦ f is a function from X to
Z, called the composition of g and f ; the symbol g ◦ f is read, “g of f ,” out loud.
1
Observe that f assigns the same element (y2 ) of Y to two different elements (x3 and x4 ) of X.
This is completely ok—by which I mean, f is still a function from X to Y —because f always assigns
exactly one element of Y to each element of X.
2
Example. If f : R2 → R is defined by
f
(x, y) 7−→ xy
and g : R → R is defined by g(t) := sin t for all t ∈ R, then
(x, y) ∈ R2
(g ◦ f )(x, y) = g(f (x, y)) = g(xy) = sin (xy)
by definition of g ◦ f : R2 → R.
Note the following important property of composition, called associativity: If W
is yet another set and h : Z → W is yet another function, then (h ◦ g) ◦ f = h ◦ (g ◦ f ).
Indeed, if x ∈ X, then
((h ◦ g) ◦ f )(x) = (h ◦ g)(f (x)) = h(g(f (x))) = h((g ◦ f )(x)) = (h ◦ (g ◦ f ))(x),
as desired. Consequently, there is no ambiguity if we write h ◦ g ◦ f for the function
(h ◦ g) ◦ f = h ◦ (g ◦ f ) : X → W ; this is what we shall do.
Next, we discuss surjectivity, injectivity, and bijectivity/invertibility of functions.
Definition. A function, f : X → Y , is called
(a) surjective if f (X) = Y , i.e., for each y ∈ Y , there is at least one solution
to f (x) = y;
(b) injective if x1 , x2 ∈ X and x1 ̸= x2 imply that f (x1 ) ̸= f (x2 ), i.e., for each
y ∈ Y , there is at most one solution to f (x) = y; and
(c) bijective or invertible if f is both surjective and injective, i.e., for each y ∈ Y ,
there is exactly one solution to f (x) = y.
If f : X → Y is bijective and y ∈ Y , then
f −1 (y) := the unique x ∈ X such that f (x) = y.
The function f −1 : Y → X is called the inverse of f ; the symbol f −1 is read, “f
inverse,” out loud.
Example. The function
X f Y
x .. - . 91
:
Ye
Xe :
-
Xio - Ye
·
Ya
Xpo-
>Y5
3
is injective because distinct inputs are mapped to distinct outputs. It is not surjective
because y4 ̸∈ f (X). In particular, f is not bijective.
Example. The function
X f Y
x
.. -
: Y
X2
- .
In
X-
-
⑧ 3
X po
Y5
·
is not injective because f (x1 ) = f (x2 ). It is also not surjective because y2 ̸∈ f (X).
(Of course, it is also the case that y5 ̸∈ f (X).) In particular, f is not bijective.
Example. The function
X f Y
x .. - : 91
X -
- ·
Ye
Xzo
X po
-
> Yz
-
is not injective because f (x3 ) = f (x4 ). It is, however, surjective. Since f is not
injective, it is, in particular, not bijective.
4
Example. The function
X f Y
X o · 91
-
-
,
X2 ·
Y2
Xzo -
> Ye
·
X po - ·
Ya
is bijective. Below is a picture of f −1 : Y → X, the inverse of f .
Y f X
9, ·
XI
2
Ye
- ·
X2
- · X3
33 - ·
Xp
Per the definition, if y ∈ Y , the statement that x = f −1 (y) is precisely the statement
that f (x) = y.
Here is another characterization of the inverse of a function.
Definition. The identity (function) on X is the function, idX : X → X, defined
by idX (x) := x.
Observation. If f : X → Y is bijective, then f f −1 (y) = y for all y ∈ Y , and
f −1 (f (x)) = x for all x ∈ X. In function-composition and identity-function notation,
f ◦ f −1 = idY , and f −1 ◦ f = idX .
Exercise. Suppose f : X → Y is bijective.
(a) Prove that if g : Y → X satisfies f ◦ g = idY , then g = f −1 .
(b) Prove that if g : Y → X satisfies g ◦ f = idX , then g = f −1 .
5
Exercise. A right inverse of a function, f : X → Y , is a function, g : Y → X,
satisfying f ◦ g = idY .
(a) Prove that if f : X → Y has a right inverse, then f is surjective.
(b) Give an example of a function with multiple distinct right inverses.
Exercise. A left inverse of a function, f : X → Y , is a function, g : Y → X,
satisfying g ◦ f = idX .
(a) Prove that if f : X → Y has a left inverse, then f is injective.
(b) Give an example of a function with multiple distinct left inverses.