Function
Function
Chapter 4:Functions
Djohra MEGUEDMI
Algebra 1.
November 2025
■ Functions
■ Exercises
Definition
■ f is a function because
Figure: exemple 1
Example 2
Figure: exemple 2
Example 2
Examples
Example
The function
IdE : E → E
x 7→ y = x
is called identity function.
Example
■ Suppose A ⊆ E . The characteristic function of A , χA : E → {0, 1}, is defined by
(
0 if x ∈
/A
χA =
1 if x ∈ A
equality of functions
Definition
Let X , Y , A, B be sets, and let f : X → Y and g : A → B be functions. We say that f
is identically equal to g, denoted by f ≡ g, if the following conditions are met:
X =A
Y =B
∀x ∈ X , f (x ) = g(x ).
Remark f , g and h are differente because they havent the same starting or arrival set.
f:R→R , g : R+ → R and h : R → R+
2 2
x 7→ x , x 7→ x , x 7→ x 2 ,
Domaine of function
Definition
For a function f : X −→ Y the domain of f is the set X .
the domain is taken to be the set of all real x for which the function is defined.
Example
■
f :R→R
1
x 7→
x
Df = R∗
exercise
Find the domain of each function using interval notation
s
1 1− | x | 1
f (x ) = √ √ , h(x ) = , g(x ) = ln ln ln(x ) , t(x ) = (1 + ln x ) x )
x− 2−x 2− | x |
Definition
Let E , F be sets, and let f : E → F be a function. Given a set A ⊆ E , we define the
image of A in F , denoted f (A), to be the subset of F given by
f (A) = {y ∈ F | ∃x ∈ A with f (x ) = y }.
Example
Define f : Z → N by f (x ) = |x | + 1. To illustrate the concept of image, let’s consider
a few subsets of Z here.
■ If U = {0, 1, 2}, then the image of U is whatever function values are assigned to
these 3 numbers. As
Notice that as U has 3 elements in it, we cannot have more than 3 elements in
f (U).
■ If U = {−2, −1, 0, 1, 2}, then the image of U is whatever function values are
assigned to these five numbers. Since
Notice that despite the fact that U has 5 elements in it, we still only have 3
elements in f (U). This is due to the fact that some elements of f (U) are assigned
to more than one member of U.
Dr. Djohra MEGUEDMI Chapter 4:Functions 11 / 42
Functions
Functions and Subsets Domaine of function
one-to-one, onto, Bijection Operations
Exercises
Example
■ If we wish to consider the range of f , we think about U = Z. In this case, we
have that every element of N is a member of the range; if n ∈ N, then by taking
z = n − 1, we have f (z) = n. Hence, for every n ∈ N, ∃z ∈ Z such that f (z) = n,
so every n ∈ N is a member of the range of f .
■ If U = {0}, then the image of U is just f (U) = {1}. In general, this is true: for
any function f : X → Y , we have that f ({x }) = {f (x )} for any x ∈ X ; that is,
the image of the set containing only one element x is the set containing only one
element, f (x ).
Example
We consider the function
f :R→R
x 7→ 2 − x
f ([0, 12 ]) = {f (x ) ∈ R, x ∈ [0, 12 ]}. We have
1
0≤x ≤ 2 =⇒ − 21 ≤ −x ≤ 0
=⇒ 23 ≤ 2 − x ≤ 2.
Then
1 3
f ([0, ]) = [ , 2]
2 2
Restriction of f to a subset
Definition
Let E , F be sets, and let f : E → F be a function. Given a set U ⊆ E , the restriction
of f to U, denoted as f |U , is the function f |U : U → F defined by f |U (x ) = f (x ) for
all x ∈ U.
The restriction of f to a subset will occasionally appear as a useful tool.
Definition
Let E , F be sets, and let f : E → F be a function. Given a subset B ⊆ F , we define
the preimage of B under f , denoted by f −1 (B), to be the subset of E given by
f −1 (B) = {x ∈ E | f (x ) ∈ B}.
Formally we have,
∀x ∈ E , x ∈ f −1 (B) ⇐⇒ f (x ) ∈ B
This is to say, the preimage of B is the set of all elements in E whose image is a
member of B. To ensure we understand the concept, let’s consider an example.
Example
We consider the function
f :R→R
x 7→ (x − 1)2
f −1 (0) = {x ∈ R | f (x ) = 0} = {1}
1 1
f −1 (]0, [) = {x ∈ R | f (x ) ∈]0, [}
2 2
To find f −1 (]0, 12 [) you must solve the inequality 0 < (x − 1)2 < 12 , it gives:
√ √
−1 1 2−1 2+1
f (]0, [) =] √ , 1[∪]1, √ [
2 2 2
Example
Let f : Z → Z with f (z) = |2z| for all z ∈ Z. Let’s consider the preimage of a few sets
B.
■ If V = {2}, then the preimage of V is all those elements in Z that map to 2; that
is, it is all choices of z for which f (z) = |2z| = 2. There are two such elements,
namely ±1. Hence f −1 (B) = {−1, 1}.
■ If B = {1}, then the preimage of V is all those elements in Z that map to 1; that
is, it is all choices of z for which f (z) = |2z| = 1. There are no such elements!
Hence, f −1 (V ) = ∅.
■ If B = {0, 1, 2, 3, 4}, then by repeating above ideas, we have that the elements in
Z for which f (z) ∈ B are exactly f −1 (B) = {−2, −1, 0, 1, 2}.
Proposition
Let f : E → F a function, A, B ⊂ E and M, N ⊂ F . We have
1- A ⊂ B =⇒ f (A) ⊂ f (B)
2- f (A ∪ B) = f (A) ∪ f (B)
3- f (A ∩ B) ⊂ f (A) ∩ f (B)
4- M ⊂ N =⇒ f −1 (M) ⊂ f −1 (N)
5- f −1 (M ∪ N) = f −1 (M) ∪ f −1 (N)
6- f −1 (M ∩ N) = f −1 (M) ∩ f −1 (N)
We shall not prove all these properties here; those that we do not prove will be left as
an exercise. In particular, we shall prove items 3 and 5.
Partial Proof.
Let X , Y , f be as in the statement of Proposition
3. Let A, B ⊆ E . Suppose that y ∈ f (A ∩ B). Then by definition, there exists
x ∈ A ∩ B having f (x ) = y . Since x ∈ A ∩ B, we thus have that x ∈ A and
x ∈ B, so y ∈ f (A) and y ∈ f (B). But then y ∈ f (A) ∩ f (B), and thus
f (A ∩ B) ⊆ f (A) ∩ f (B).
Remark
Counter example why you haven’t f (A ∩ B) = f (A) ∩ f (B)
Composite Functions
Definition
Let f : G → E and g : F → G two functions. We call the composite of the functions g
and f , the function denoted f ◦ g defined from F in E by
∀x ∈ F , f ◦ g(x ) = f (g(x ))
Composite Functions
Composite Functions
Example
Let f , g : R → R where f (x ) = x 2 and g(x ) = x + 1. Then
(g ◦ f )(x ) = g(x 2 ) = x 2 + 1,
while
(f ◦ g)(x ) = f (x + 1) = (x + 1)2 = x 2 + 2x + 1,
Therefore, in general,
g ◦ f ̸= f ◦ g
Composite Functions
Proposition
LetE , F , G and H be four sets. For all functions f : E → F , g : F → G and
h : G → H, we have:
(h ◦ g) ◦ f = h ◦ (g ◦ f )
∀x , x ′ ∈ E ; f (x ) = f (x ′ ) =⇒ x = x ′
∀x , x ′ ∈ E ; x ̸= x ′ =⇒ f (x ) ̸= f (x ′ )
Example
Show that the function g : R −→ R defined by g(x ) = x 3 − x is not injective.
Proof.
Notice that when x = 0, we obtain g(x ) = 03 − 0 = 0, and when x = 1, we have
g(x ) = 13 − 1 = 0. Therefore, as g(0) = g(1), and 0 ̸= 1, we have that g is not
injective.
One-to-One
The functions f represented are one-to-one or injective:
Theorem
Let X , Y , Z be sets, and let f : X → Y and g : Y → Z be functions. If g and f are
both injective, then g ◦ f is injective.
Example
Proof of Theorem .
Let f , g be as in the statement of the theorem, and suppose that both f and g are
injective. We wish to prove that g ◦ f is also injective.
Let x1 , x2 ∈ X , having g ◦ f (x1 ) = g ◦ f (x2 ).
By definition, then g(f (x1 )) = g(f (x2 )). Since g is injective, this implies that
f (x1 ) = f (x2 ).
Since f is injective, this implies that x1 = x2 . Therefore, by definition, g ◦ f is
injective.
Definition
A function f : E → F is onto or surjective if we have
∀y ∈ F , ∃x ∈ E , y = f (x )
A surjection is also known as an onto function. From the definition, f is surjective if,
and only, if f (E ) = F .
Example
■ Show that the function f : R −→ R given by f (x ) = 2x + 1 is one-to-one and
onto.
■ Show that the function f : Z −→ Z given by f (n) = 2n + 1 is one-to-one but not
onto.
The function f is surjective if and only if the equation y = f (x ) admits at least one
solution x of E for any element y of F .
Example
Let f : Z → N be defined by f (z) = |z| + 2. Prove that f is not surjective.
Proof.
Notice that for any z ∈ Z, we have that f (z) ≥ 2. Therefore, if y = 1, there is no
z ∈ Z such that f (z) = y . Hence, f is not surjective.
The function f represented are surjective: Here are two non-surjective functions:
The converse here is false, and the example can prove it.
Example
Bijection
Definition
A function that is both injective and surjective is said to be bijective.
Proposition
The function f is bijective if and only if
∀y ∈ F , ∃! x ∈ E , y = f (x )
Inverse function
∀x ∈ E , y ∈ F , y = f (x ) ⇐⇒ x = f −1 (y )
Proposition
Let f : E → F be a bijective map, then f ◦ f −1 = IdF and f −1 ◦ f = IdE
Inverse function
Remark :
1- f ◦ f −1 = IdF is reformulated as follows: ∀y ∈ F , f (f −1 (y )) = y .
While f −1 ◦ f = IdE is written ∀x ∈ E , f −1 (f (x )) = x .
2- If f is bijective, we have (f −1 )−1 = f .
Examples
1- If E is a set, IdE is bijective and IdE−1 = IdE
2- Let f : R → R∗+ defined by: f (x ) = exp(x ) is bijective and its inverse bijection is
f −1 : R∗+ → R defined by f −1 (y ) = ln(y ). We have exp(ln(y )) = y for all y ∈ R∗+
and ln(exp(x )) = x for all x ∈ R.
3- we take the previous example. We had previously shown that it is injective and
surjective so it is a bijection. its inverse map is:
f −1 : R → R
x −1
x 7→ f −1 (x ) =
2
Composite functions
Proposition 1
Let E , F , G be three sets, f : E → F and g : F → G two functions.
1- If f and g are both one-to-one then g ◦ f is one-to-one.
2- If f and g are both onto then g ◦ f is onto.
3- If g ◦ f is one-to-one then f is one-to-one.
4- If g ◦ f is onto then g is onto.