Functions
Functions
Functions
Function. Given two sets A and B, a function from A to B is a rule
that assigns each element x ∈ A exactly one element of B. Formally, we
write
f :A→B (1)
The set A is the domain of the function, denoted by D(f ) or dom(f ), and
it is the set that contains all the values for which the function is define. The
set B, called the codomain of the function, is the set into which all of the
output of the function is constrained to fall. The subset of the codomain that
includes all output values that the function may produce is called the image
of the function and it is denoted by img(f ).
absolute value of any number is always positive. The absolute value function
is define in the next way:
x if x ≥ x
|x| = (2)
−x if x < 0
Given two functions, f (x) and g(x), the composite function f ◦ g is defined
by
(f ◦ g)(x) = f [g(x)] (3)
The domain of this composite function is given by the intersection of the do-
main of f (x) and the domain of g(x). In other words, the domain of the
composite function includes all the values where both f (x) and g(x) are de-
fined.
Example 1.1. Given the next two functions: f (x) = x3 and g(x) = x + 5,
obtain f ◦ g and g ◦ f .
f ◦ g = f [g(x)] = f (x + 5) = (x + 5)3
We can classify functions due to how the elements of the domain, codomain
and image are related to each other. Then we have three types of functions:
3
• Injective functions.
• Superjective functions.
• Bijective functions.
In words, a function is injective if there are not two elements in the domain of
the function with the same image.
∀y ∈ C, ∃x ∈ D : f (x) = y (5)
Let f be a bijective function with domain D and codomain C. Then its inverse
function, denoted by f −1 (x), has domain C and codomain D and is defined
by
f −1 (y) = x ⇐⇒ f (x) = y, ∀x ∈ D, ∀y ∈ C (7)
4 / Functions
It is important to emphasise that only those functions that are bijective have
inverse function, neither injectives nor surjectives have it. Why is that?
We have said that the domain of the inverse function is the codomain of the
function. With an injective function we have that there are more elements in
the codomain than in the domain. Then, if we try to find the inverse function
we are going to see that we cannot assign each element of the new domain (the
codomain of the function) with one element of the new codomain (the domain
of the function), so we are not in front of a function because for each element
of the domain we cannot find exactly one element of the codomain.
The reason why surjective functions do not have inverse functions is also be-
cause the inverse function of a surjective function does not meet the definition
of function. If we look at a surjective function we are going to see that if we
try to assign each element of the codomain (which would be the domain of
the inverse function) with exactly one element of the domain (which would
be the codomain of the inverse function) we are going to have some elements
5
in the codomain that corresponds to more than one element of the domain.
Therefore, this does not meet the definition of function because each element
of the domain has to correspond exactly to one element in the codomain.
A function f is even if f (−x) = f (x) for all x ∈ dom(f ). For example, the
next functions are even: f (x) = x2 , f (x) = |x| or f (x) = cos(x). A function
f is odd if f (−x) = −f (x). Some examples of odd functions are: f (x) = x,
f (x) = x3 or f (x) = sin(x).