Skip to main content
Home
Pimath

Menu EN

  • Home
  • 🌐 EN
    • 🇮🇹 IT
    • 🇪🇸 ES
    • 🇵🇹 PT
    • 🇫🇷 FR
    • 🇷🇴 RO
  • 👨‍🎓 About Me
  • 🚧 Theory & Exercises
User account menu
  • Log in

Breadcrumb

  1. Home

Injective, Surjective, and Bijective Functions: 20 Step-by-Step Practice Problems

Profile picture for user Pimath
By Pimath, 12 June, 2026

We present a collection of 20 step-by-step practice problems on injective, surjective, and bijective functions, designed to build a rigorous, step-by-step understanding of three fundamental properties of functions.

Let us briefly recall that a function \(f:A\to B\) is said to be:

  • injective if distinct elements of the domain have distinct images;
  • surjective if every element of the codomain is the image of at least one element of the domain;
  • bijective if it is both injective and surjective.

In symbols:

\[ f \text{ is injective} \iff f(x_1)=f(x_2) \Rightarrow x_1=x_2. \]

\[ f \text{ is surjective} \iff f(A)=B. \]


Exercise 1 — level ★☆☆☆☆

Consider the function:

\[ f:\mathbb{R}\to\mathbb{R}, \qquad f(x)=2x+1. \]

Determine whether \(f\) is injective.

Answer

The function is injective.

Solution

To decide whether a function is injective, we must check whether two elements of the domain sharing the same image are necessarily equal.

Suppose, then, that:

\[ f(x_1)=f(x_2). \]

Since \(f(x)=2x+1\), we obtain:

\[ 2x_1+1=2x_2+1. \]

Subtracting \(1\) from both sides:

\[ 2x_1=2x_2. \]

Dividing by \(2\):

\[ x_1=x_2. \]

We have shown that:

\[ f(x_1)=f(x_2)\Rightarrow x_1=x_2. \]

Therefore the function is injective.


Exercise 2 — level ★☆☆☆☆

Consider the function:

\[ f:\mathbb{R}\to\mathbb{R}, \qquad f(x)=x^2. \]

Determine whether \(f\) is injective.

Answer

The function is not injective.

Solution

To show that a function is not injective, it suffices to exhibit two distinct elements of the domain with the same image.

Consider:

\[ x_1=2, \qquad x_2=-2. \]

Clearly:

\[ 2\ne -2. \]

Let us now compute the images:

\[ f(2)=2^2=4. \]

Moreover:

\[ f(-2)=(-2)^2=4. \]

Hence:

\[ f(2)=f(-2), \]

even though \(2\ne -2\).

There thus exist two distinct elements of the domain with the same image.

Therefore the function is not injective.


Exercise 3 — level ★☆☆☆☆

Consider the function:

\[ f:[0,+\infty)\to\mathbb{R}, \qquad f(x)=x^2. \]

Determine whether \(f\) is injective.

Answer

The function is injective.

Solution

The rule of the function is again \(f(x)=x^2\), but the domain is no longer all of \(\mathbb{R}\). The domain is now:

\[ [0,+\infty). \]

This detail is crucial. On all of \(\mathbb{R}\) the squaring function fails to be injective; restricted to the non-negative numbers, however, it becomes injective.

Suppose that:

\[ f(x_1)=f(x_2). \]

Then:

\[ x_1^2=x_2^2. \]

Since \(x_1\) and \(x_2\) both belong to \([0,+\infty)\), they are both non-negative.

Two non-negative numbers with the same square must be equal.

Hence:

\[ x_1=x_2. \]

Therefore:

\[ f(x_1)=f(x_2)\Rightarrow x_1=x_2. \]

The function is therefore injective.


Exercise 4 — level ★★☆☆☆

Consider the function:

\[ f:\mathbb{R}\to\mathbb{R}, \qquad f(x)=x^3. \]

Determine whether \(f\) is injective.

Answer

The function is injective.

Solution

We verify injectivity straight from the definition.

Suppose that:

\[ f(x_1)=f(x_2). \]

Since \(f(x)=x^3\), we obtain:

\[ x_1^3=x_2^3. \]

The cube-root function is defined on all of \(\mathbb{R}\). We may therefore take the cube root of both sides:

\[ \sqrt[3]{x_1^3}=\sqrt[3]{x_2^3}. \]

Consequently:

\[ x_1=x_2. \]

We have shown that two elements with the same image are necessarily equal.

Therefore the function is injective.


Exercise 5 — level ★★☆☆☆

Consider the function:

\[ f:\mathbb{R}\to\mathbb{R}, \qquad f(x)=x^2+1. \]

Determine whether \(f\) is surjective.

Answer

The function is not surjective.

Solution

A function \(f:A\to B\) is surjective if every element of the codomain \(B\) is actually attained by the function.

Here the codomain is:

\[ \mathbb{R}. \]

Let us examine the values attained by:

\[ f(x)=x^2+1. \]

For every \(x\in\mathbb{R}\) we have:

\[ x^2\ge 0. \]

Hence:

\[ x^2+1\ge 1. \]

The function takes only values greater than or equal to \(1\).

For instance, the number \(0\) belongs to the codomain \(\mathbb{R}\) but is never attained by the function.

Indeed, the equation:

\[ x^2+1=0 \]

is equivalent to:

\[ x^2=-1, \]

which has no real solutions.

There thus exists at least one element of the codomain that is not the image of any element of the domain.

Therefore the function is not surjective.


Exercise 6 — level ★★☆☆☆

Consider the function:

\[ f:\mathbb{R}\to[1,+\infty), \qquad f(x)=x^2+1. \]

Determine whether \(f\) is surjective.

Answer

The function is surjective.

Solution

The rule of the function is the same as in the previous exercise:

\[ f(x)=x^2+1. \]

The codomain, however, has changed. We now have:

\[ f:\mathbb{R}\to[1,+\infty). \]

To prove surjectivity, we must show that every element of \([1,+\infty)\) is attained by the function.

So let:

\[ y\in[1,+\infty). \]

We seek \(x\in\mathbb{R}\) such that:

\[ f(x)=y. \]

That is:

\[ x^2+1=y. \]

Subtracting \(1\) from both sides:

\[ x^2=y-1. \]

Since \(y\ge 1\), we have:

\[ y-1\ge 0. \]

We may therefore choose:

\[ x=\sqrt{y-1}. \]

This value belongs to \(\mathbb{R}\). Moreover:

\[ f(\sqrt{y-1})=(\sqrt{y-1})^2+1=y. \]

We have shown that every element of the codomain is the image of at least one element of the domain.

Therefore the function is surjective.


Exercise 7 — level ★★☆☆☆

Consider the function:

\[ f:\mathbb{R}\to\mathbb{R}, \qquad f(x)=2x-5. \]

Determine whether \(f\) is bijective.

Answer

The function is bijective.

Solution

A function is bijective if it is both injective and surjective.

We first verify injectivity.

Suppose that:

\[ f(x_1)=f(x_2). \]

Then:

\[ 2x_1-5=2x_2-5. \]

Adding \(5\) to both sides:

\[ 2x_1=2x_2. \]

Dividing by \(2\):

\[ x_1=x_2. \]

Hence \(f\) is injective.

We now verify surjectivity.

Let:

\[ y\in\mathbb{R}. \]

We seek \(x\in\mathbb{R}\) such that:

\[ 2x-5=y. \]

Solving:

\[ 2x=y+5, \]

hence:

\[ x=\frac{y+5}{2}. \]

This value is real for every \(y\in\mathbb{R}\), so every element of the codomain is attained.

The function is surjective.

Being both injective and surjective, the function is bijective.


Exercise 8 — level ★★☆☆☆

Consider the function:

\[ f:\mathbb{R}\to\mathbb{R}, \qquad f(x)=x^2. \]

Determine whether \(f\) is bijective.

Answer

The function is not bijective.

Solution

A function is bijective if it is both injective and surjective.

We examine the two properties separately.

The function is not injective. Indeed:

\[ f(2)=2^2=4 \]

and:

\[ f(-2)=(-2)^2=4. \]

Hence:

\[ f(2)=f(-2), \]

even though \(2\ne -2\).

So \(f\) is not injective.

Nor is it surjective onto \(\mathbb{R}\), because:

\[ x^2\ge 0 \qquad \forall x\in\mathbb{R}. \]

The function never takes negative values.

For instance:

\[ -1\in\mathbb{R} \]

belongs to the codomain but is not the image of any element of the domain.

The function is therefore not surjective.

Since it is neither injective nor surjective, it is not bijective.


Exercise 9 — level ★★★☆☆

Consider the function:

\[ f:(0,+\infty)\to\mathbb{R}, \qquad f(x)=\ln(x). \]

Determine whether \(f\) is bijective.

Answer

The function is bijective.

Solution

We examine injectivity and surjectivity separately.

We first verify injectivity.

Suppose that:

\[ f(x_1)=f(x_2). \]

Then:

\[ \ln(x_1)=\ln(x_2). \]

The natural logarithm is strictly increasing on the interval:

\[ (0,+\infty). \]

Consequently, two equal logarithms force:

\[ x_1=x_2. \]

The function is therefore injective.

We now verify surjectivity.

Let:

\[ y\in\mathbb{R}. \]

We seek \(x\gt0\) such that:

\[ \ln(x)=y. \]

Exponentiating both sides:

\[ x=e^y. \]

Since:

\[ e^y\gt0 \]

for every \(y\in\mathbb{R}\), the value found belongs to the domain.

Moreover:

\[ \ln(e^y)=y. \]

So every element of the codomain is indeed attained.

The function is surjective.

Being both injective and surjective, the function is bijective.


Exercise 10 — level ★★★☆☆

Consider the function:

\[ f:\mathbb{R}\to[0,+\infty), \qquad f(x)=x^2. \]

Determine whether \(f\) is surjective.

Answer

The function is surjective.

Solution

The codomain of the function is:

\[ [0,+\infty). \]

To verify surjectivity, we must show that every element of this set is attained by the function.

So let:

\[ y\in[0,+\infty). \]

We seek \(x\in\mathbb{R}\) such that:

\[ x^2=y. \]

Since:

\[ y\ge0, \]

we may choose:

\[ x=\sqrt{y}. \]

This value belongs to \(\mathbb{R}\). Moreover:

\[ f(\sqrt{y})=(\sqrt{y})^2=y. \]

Every element of the codomain is therefore attained by the function.

Therefore the function is surjective.


Exercise 11 — level ★★★☆☆

Consider the function:

\[ f:\mathbb{R}\setminus\{0\}\to\mathbb{R}\setminus\{0\}, \qquad f(x)=\frac{1}{x}. \]

Determine whether \(f\) is bijective.

Answer

The function is bijective.

Solution

We first verify injectivity.

Suppose that:

\[ f(x_1)=f(x_2). \]

We obtain:

\[ \frac{1}{x_1}=\frac{1}{x_2}. \]

Multiplying both sides by \(x_1x_2\), which is non-zero, we obtain:

\[ x_2=x_1. \]

The function is therefore injective.

We now verify surjectivity.

Let:

\[ y\in\mathbb{R}\setminus\{0\}. \]

We seek \(x\ne0\) such that:

\[ \frac{1}{x}=y. \]

Solving:

\[ x=\frac{1}{y}. \]

Since \(y\ne0\), this value is well defined and belongs to the domain.

Moreover:

\[ f\left(\frac{1}{y}\right)=\frac{1}{\frac{1}{y}}=y. \]

The function is therefore surjective.

Being both injective and surjective, the function is bijective.


Exercise 12 — level ★★★☆☆

Consider the function:

\[ f:\mathbb{R}\to\mathbb{R}, \qquad f(x)=|x|. \]

Determine whether \(f\) is injective.

Answer

The function is not injective.

Solution

To show that a function is not injective, it suffices to exhibit two distinct elements of the domain with the same image.

Consider:

\[ x_1=3, \qquad x_2=-3. \]

Clearly:

\[ 3\ne -3. \]

However:

\[ f(3)=|3|=3 \]

and:

\[ f(-3)=|-3|=3. \]

Hence:

\[ f(3)=f(-3), \]

even though:

\[ 3\ne -3. \]

The function is therefore not injective.


Exercise 13 — level ★★★★☆

Consider the function:

\[ f:[0,+\infty)\to[0,+\infty), \qquad f(x)=|x|. \]

Determine whether \(f\) is bijective.

Answer

The function is bijective.

Solution

On the interval:

\[ [0,+\infty), \]

the absolute value coincides with the identity function:

\[ |x|=x. \]

The function therefore becomes:

\[ f(x)=x. \]

We verify injectivity.

If:

\[ f(x_1)=f(x_2), \]

then:

\[ x_1=x_2. \]

The function is therefore injective.

We now verify surjectivity.

Let:

\[ y\in[0,+\infty). \]

It suffices to choose:

\[ x=y. \]

Indeed, for \(x=y\), we have:

\[ f(x)=f(y)=y. \]

Every element of the codomain is therefore attained.

The function is surjective.

Therefore the function is bijective.


Exercise 14 — level ★★★★☆

Consider the function:

\[ f:\mathbb{R}\to[0,+\infty), \qquad f(x)=|x|. \]

Determine whether \(f\) is surjective.

Answer

The function is surjective.

Solution

To verify surjectivity, we must check whether every element of the codomain is attained by the function.

The codomain is:

\[ [0,+\infty). \]

So let:

\[ y\in[0,+\infty). \]

We must find at least one \(x\in\mathbb{R}\) such that:

\[ |x|=y. \]

Since \(y\ge 0\), we may choose:

\[ x=y. \]

Indeed:

\[ f(y)=|y|=y. \]

So every element of the codomain \([0,+\infty)\) is indeed reached by the function.

Therefore \(f\) is surjective.


Exercise 15 — level ★★★★☆

Consider the function:

\[ f:\mathbb{R}\to\mathbb{R}, \qquad f(x)=x^3-1. \]

Determine whether \(f\) is bijective.

Answer

The function is bijective.

Solution

To determine whether \(f\) is bijective, we must verify that it is both injective and surjective.

We first examine injectivity.

Suppose that:

\[ f(x_1)=f(x_2). \]

Since \(f(x)=x^3-1\), we obtain:

\[ x_1^3-1=x_2^3-1. \]

Adding \(1\) to both sides:

\[ x_1^3=x_2^3. \]

Taking the cube root:

\[ x_1=x_2. \]

Hence \(f\) is injective.

We now verify surjectivity.

Let:

\[ y\in\mathbb{R}. \]

We seek \(x\in\mathbb{R}\) such that:

\[ x^3-1=y. \]

Adding \(1\) to both sides:

\[ x^3=y+1. \]

Taking the cube root:

\[ x=\sqrt[3]{y+1}. \]

This value is real for every \(y\in\mathbb{R}\).

Moreover:

\[ f\left(\sqrt[3]{y+1}\right) = \left(\sqrt[3]{y+1}\right)^3-1 = y+1-1 = y. \]

So every element of the codomain is attained by the function.

The function is surjective.

Being both injective and surjective, \(f\) is bijective.


Exercise 16 — level ★★★★☆

Consider the function:

\[ f:[0,+\infty)\to[1,+\infty), \qquad f(x)=x^2+1. \]

Determine whether \(f\) is bijective.

Answer

The function is bijective.

Solution

We first verify injectivity.

Suppose that:

\[ f(x_1)=f(x_2). \]

Then:

\[ x_1^2+1=x_2^2+1. \]

Subtracting \(1\) from both sides:

\[ x_1^2=x_2^2. \]

Since \(x_1,x_2\in[0,+\infty)\), both are non-negative.

Two non-negative numbers with the same square are equal.

Hence:

\[ x_1=x_2. \]

The function is injective.

We now verify surjectivity.

Let:

\[ y\in[1,+\infty). \]

We seek \(x\in[0,+\infty)\) such that:

\[ x^2+1=y. \]

We obtain:

\[ x^2=y-1. \]

Since \(y\ge 1\), we have \(y-1\ge 0\). We may therefore choose:

\[ x=\sqrt{y-1}. \]

This value belongs to \([0,+\infty)\). Moreover:

\[ f(\sqrt{y-1}) = (\sqrt{y-1})^2+1 = y. \]

The function is thus surjective.

Being both injective and surjective, \(f\) is bijective.


Exercise 17 — level ★★★★☆

Consider the function:

\[ f:\mathbb{R}\to\mathbb{R}, \qquad f(x)=x^2-4x+3. \]

Determine whether \(f\) is injective.

Answer

The function is not injective.

Solution

To check whether the function is injective, we look for two distinct elements of the domain with the same image.

We compute:

\[ f(1)=1^2-4\cdot1+3=1-4+3=0. \]

We also compute:

\[ f(3)=3^2-4\cdot3+3=9-12+3=0. \]

Hence:

\[ f(1)=f(3), \]

but:

\[ 1\ne 3. \]

We have found two distinct elements of the domain with the same image.

Therefore the function is not injective.

Let us also note the geometric reason: by completing the square we obtain:

\[ x^2-4x+3=(x-2)^2-1. \]

The graph is a parabola with axis of symmetry \(x=2\). For this reason, over all of \(\mathbb{R}\), the function frequently takes the same value at two distinct points.


Exercise 18 — level ★★★★★

Consider the function:

\[ f:[2,+\infty)\to[-1,+\infty), \qquad f(x)=x^2-4x+3. \]

Determine whether \(f\) is bijective.

Answer

The function is bijective.

Solution

We rewrite the function by completing the square:

\[ f(x)=x^2-4x+3=(x-2)^2-1. \]

The domain is:

\[ [2,+\infty). \]

On this interval \(x-2\ge 0\). The function:

\[ (x-2)^2-1 \]

is increasing for \(x\ge 2\).

We verify injectivity directly.

Suppose that:

\[ f(x_1)=f(x_2). \]

Then:

\[ (x_1-2)^2-1=(x_2-2)^2-1. \]

Adding \(1\) to both sides:

\[ (x_1-2)^2=(x_2-2)^2. \]

Since \(x_1,x_2\in[2,+\infty)\), we have:

\[ x_1-2\ge 0 \qquad\text{and}\qquad x_2-2\ge 0. \]

Two non-negative numbers with the same square are equal. Hence:

\[ x_1-2=x_2-2. \]

Therefore:

\[ x_1=x_2. \]

The function is injective.

We now verify surjectivity.

Let:

\[ y\in[-1,+\infty). \]

We seek \(x\in[2,+\infty)\) such that:

\[ (x-2)^2-1=y. \]

We obtain:

\[ (x-2)^2=y+1. \]

Since \(y\ge -1\), we have:

\[ y+1\ge 0. \]

Moreover, since \(x\ge 2\), we must take the non-negative root:

\[ x-2=\sqrt{y+1}. \]

Whence:

\[ x=2+\sqrt{y+1}. \]

This value belongs to \([2,+\infty)\). Indeed:

\[ 2+\sqrt{y+1}\ge 2. \]

Moreover:

\[ f(2+\sqrt{y+1}) = (2+\sqrt{y+1}-2)^2-1 = (\sqrt{y+1})^2-1 = y. \]

Every element of the codomain is therefore reached.

The function is surjective.

Being both injective and surjective, \(f\) is bijective.


Exercise 19 — level ★★★★★

Consider the function:

\[ f:\mathbb{R}\setminus\{1\}\to\mathbb{R}\setminus\{2\}, \qquad f(x)=\frac{2x+1}{x-1}. \]

Determine whether \(f\) is bijective.

Answer

The function is bijective.

Solution

To determine whether \(f\) is bijective, we must verify that it is both injective and surjective.

We first verify injectivity.

Suppose that:

\[ f(x_1)=f(x_2). \]

Then:

\[ \frac{2x_1+1}{x_1-1} = \frac{2x_2+1}{x_2-1}. \]

Since \(x_1\ne1\) and \(x_2\ne1\), we may cross-multiply:

\[ (2x_1+1)(x_2-1)=(2x_2+1)(x_1-1). \]

Expanding the left-hand side:

\[ (2x_1+1)(x_2-1)=2x_1x_2-2x_1+x_2-1. \]

Expanding the right-hand side:

\[ (2x_2+1)(x_1-1)=2x_1x_2-2x_2+x_1-1. \]

Hence:

\[ 2x_1x_2-2x_1+x_2-1 = 2x_1x_2-2x_2+x_1-1. \]

Subtracting \(2x_1x_2\) and adding \(1\) to both sides:

\[ -2x_1+x_2=-2x_2+x_1. \]

Moving the terms in \(x_1\) to one side and those in \(x_2\) to the other:

\[ -3x_1=-3x_2. \]

Dividing by \(-3\), we obtain:

\[ x_1=x_2. \]

Hence \(f\) is injective.

We now verify surjectivity.

Let:

\[ y\in\mathbb{R}\setminus\{2\}. \]

We seek \(x\in\mathbb{R}\setminus\{1\}\) such that:

\[ \frac{2x+1}{x-1}=y. \]

We multiply by \(x-1\):

\[ 2x+1=y(x-1). \]

Expanding:

\[ 2x+1=yx-y. \]

We move the terms containing \(x\) to one side:

\[ 2x-yx=-y-1. \]

We factor out \(x\):

\[ x(2-y)=-(y+1). \]

Since \(y\ne2\), we may divide by \(2-y\):

\[ x=\frac{-(y+1)}{2-y}. \]

Equivalently:

\[ x=\frac{y+1}{y-2}. \]

This value is real for every \(y\ne2\). We must also check that it belongs to the domain, that is, that it differs from \(1\).

If we had:

\[ \frac{y+1}{y-2}=1, \]

then we would have:

\[ y+1=y-2, \]

that is:

\[ 1=-2, \]

which is impossible.

Hence the value found always belongs to the domain.

Moreover:

\[ f\left(\frac{y+1}{y-2}\right) = \frac{2\cdot\frac{y+1}{y-2}+1}{\frac{y+1}{y-2}-1}. \]

Simplifying the numerator, we get:

\[ 2\cdot\frac{y+1}{y-2}+1 = \frac{2y+2+y-2}{y-2} = \frac{3y}{y-2}. \]

Simplifying the denominator, we get:

\[ \frac{y+1}{y-2}-1 = \frac{y+1-y+2}{y-2} = \frac{3}{y-2}. \]

Therefore:

\[ f\left(\frac{y+1}{y-2}\right) = \frac{\frac{3y}{y-2}}{\frac{3}{y-2}} = y. \]

Every element of the codomain therefore has at least one preimage.

The function is surjective.

Being both injective and surjective, \(f\) is bijective.


Exercise 20 — level ★★★★★

Consider the function:

\[ f:\left(-\frac{\pi}{2},\frac{\pi}{2}\right)\to\mathbb{R}, \qquad f(x)=\tan(x). \]

Determine whether \(f\) is bijective.

Answer

The function is bijective.

Solution

To determine whether \(f\) is bijective, we must verify that it is both injective and surjective.

We first examine injectivity.

On the interval:

\[ \left(-\frac{\pi}{2},\frac{\pi}{2}\right) \]

the tangent function is strictly increasing.

A strictly increasing function assigns distinct images to distinct elements of the domain.

Hence \(f\) is injective.

We now verify surjectivity.

The codomain is:

\[ \mathbb{R}. \]

We must show that every real number is attained by the function.

Let:

\[ y\in\mathbb{R}. \]

We seek \(x\in\left(-\frac{\pi}{2},\frac{\pi}{2}\right)\) such that:

\[ \tan(x)=y. \]

The natural choice is:

\[ x=\arctan(y). \]

By definition, the arctangent function takes values in the interval:

\[ \left(-\frac{\pi}{2},\frac{\pi}{2}\right). \]

Hence:

\[ \arctan(y)\in\left(-\frac{\pi}{2},\frac{\pi}{2}\right). \]

Moreover:

\[ \tan(\arctan(y))=y. \]

We have thus found, for every \(y\in\mathbb{R}\), at least one element of the domain whose image is \(y\).

The function is surjective.

Being both injective and surjective, \(f\) is bijective.


Your feedback is important to us! Leave a comment and help us improve this content. Thank you!

Feedback

Support us by liking the page:
Or, share:

Tags

  • Mathematical Analysis 1

Support us by liking the page:
Or, share:

Copyright © 2026 | Pimath | All Rights Reserved