Skip to main content
Home
Pimath

Menu EN

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

Breadcrumb

  1. Home

Injective, Surjective and Bijective Functions: Worked Examples

Profile picture for user Pimath
By Pimath, 19 April, 2026

Exercise 1 — level ★☆☆☆☆

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

Answer

The function is bijective.

Solution

Injectivity

To check whether the function is injective, suppose two elements share the same image:

\[ f(x_1)=f(x_2) \implies 2x_1+1=2x_2+1 \]

Cancelling the constant term gives:

\[ 2x_1=2x_2 \implies x_1=x_2 \]

Therefore distinct inputs always produce distinct outputs: the function is injective.

Surjectivity

To determine surjectivity, take any real number \(y\) and check whether there exists an \(x\) such that \(f(x)=y\):

\[ y=2x+1 \]

Solving for \(x\):

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

This value is always real, so every real number is the image of at least one element of the domain. The function is surjective.

Conclusion

Being both injective and surjective, the function is bijective.

\[ \boxed{f \text{ is bijective}} \]

Exercise 2 — level ★☆☆☆☆

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

Answer

Neither injective nor surjective (on \(\mathbb{R}\)).

Solution

Injectivity

It suffices to exhibit two distinct inputs with the same output. For example:

\[ f(1)=1, \qquad f(-1)=1 \]

Since \(1\neq -1\) yet their images coincide, the function is not injective.

Surjectivity

The square of any real number is always non-negative:

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

Hence the range of the function is contained in \([0,+\infty)\). In particular, no negative number is the image of any \(x\).

Therefore the function is not surjective on \(\mathbb{R}\).

Conclusion

\[ \boxed{f \text{ is neither injective nor surjective}} \]

Exercise 3 — level ★☆☆☆☆

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

Answer

The function is bijective.

Solution

Injectivity

Suppose:

\[ f(x_1)=f(x_2) \implies x_1^3=x_2^3 \]

Since the cubic function is strictly increasing, this equality necessarily implies:

\[ x_1=x_2 \]

Hence the function is injective.

Surjectivity

Take any \(y\in\mathbb{R}\) and consider the equation:

\[ y=x^3 \]

It always has a real solution:

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

This shows that every real number is the image of some \(x\), so the function is surjective.

Conclusion

\[ \boxed{f \text{ is bijective}} \]

Exercise 4 — level ★☆☆☆☆

\[ f:\mathbb{N}\to\mathbb{N}, \quad f(n)=n+1 \]

Answer

Injective but not surjective.

Solution

Injectivity

Suppose two natural numbers share the same image:

\[ f(n_1)=f(n_2) \implies n_1+1=n_2+1 \]

It follows immediately that:

\[ n_1=n_2 \]

Hence the function is injective.

Surjectivity

The value \(0\) (or \(1\), depending on the convention for \(\mathbb{N}\)) is not the image of any natural number.

Indeed, there is no \(n\in\mathbb{N}\) such that \(n+1=0\).

Therefore the function is not surjective.

Conclusion

\[ \boxed{f \text{ is injective but not surjective}} \]

Exercise 5 — level ★☆☆☆☆

\[ f:\mathbb{R}\to\mathbb{R}, \quad f(x)=5 \]

Answer

Neither injective nor surjective.

Solution

Injectivity

The function assigns the same value to every real number:

\[ f(x)=5 \quad \forall x\in\mathbb{R} \]

So distinct inputs share the same output. The function is not injective.

Surjectivity

The range of the function consists of the single value \(5\):

\[ \operatorname{Im}(f)=\{5\} \]

Since this set does not coincide with \(\mathbb{R}\), the function is not surjective.

Conclusion

\[ \boxed{f \text{ is neither injective nor surjective}} \]

Exercise 6 — level ★★☆☆☆

\[ f:\mathbb{Z}\to\mathbb{Z}, \quad f(n)=2n \]

Answer

Injective but not surjective.

Solution

Injectivity

Suppose:

\[ f(n_1)=f(n_2) \implies 2n_1=2n_2 \]

Dividing by \(2\) gives:

\[ n_1=n_2 \]

Hence the function is injective.

Surjectivity

The values assumed by the function are precisely the even integers:

\[ \operatorname{Im}(f)=\{2n \mid n\in\mathbb{Z}\} \]

Odd integers are not the image of any element of the domain, so the function is not surjective.

Conclusion

\[ \boxed{f \text{ is injective but not surjective}} \]

Exercise 7 — level ★★☆☆☆

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

Answer

Neither injective nor surjective.

Solution

Injectivity

As in the case of \(x^2\), we have:

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

Distinct inputs share the same image, so the function is not injective.

Surjectivity

We observe that:

\[ x^2 \ge 0 \implies x^2+1 \ge 1 \]

Therefore:

\[ \operatorname{Im}(f)=[1,+\infty) \]

Numbers less than \(1\) are never attained, so the function is not surjective.

Conclusion

\[ \boxed{f \text{ is neither injective nor surjective}} \]

Exercise 8 — level ★★☆☆☆

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

Answer

Surjective but not injective.

Solution

Injectivity

As already seen:

\[ f(1)=f(-1)=1 \]

with \(1\neq -1\), so the function is not injective.

Surjectivity

The codomain is now \([0,+\infty)\). Let \(y\ge 0\); we need to verify that there exists \(x\) such that:

\[ y=x^2 \]

This equation always has a real solution:

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

So every element of the codomain is indeed attained, and the function is surjective.

Conclusion

\[ \boxed{f \text{ is surjective but not injective}} \]

Exercise 9 — level ★★☆☆☆

\[ f:\mathbb{R}\to\mathbb{R}, \quad f(x)= \begin{cases} x & x\ge 0 \\ -x & x<0 \end{cases} \]

Answer

Neither injective nor surjective.

Solution

Interpretation

This function coincides with the absolute value:

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

Injectivity

For example:

\[ f(1)=1,\qquad f(-1)=1 \]

with distinct inputs from the domain. Hence the function is not injective.

Surjectivity

Since \(|x|\ge 0\), the range is:

\[ \operatorname{Im}(f)=[0,+\infty) \]

Negative numbers are never attained, so the function is not surjective on \(\mathbb{R}\).

Conclusion

\[ \boxed{f \text{ is neither injective nor surjective}} \]

Exercise 10 — level ★★☆☆☆

\[ f:\mathbb{R}\to\mathbb{R}, \quad f(x)=e^x \]

Answer

Injective but not surjective.

Solution

Injectivity

The exponential function is strictly increasing on all of \(\mathbb{R}\). This means that whenever \(x_1<x_2\), we have:

\[ e^{x_1} < e^{x_2} \]

Consequently, no two distinct inputs can share the same output. The function is therefore injective.

Surjectivity

We observe that:

\[ e^x > 0 \quad \forall x\in\mathbb{R} \]

So the range of the function is:

\[ \operatorname{Im}(f)=(0,+\infty) \]

Negative numbers and zero are never attained, so not every real value is reached.

The function is not surjective on \(\mathbb{R}\).

Conclusion

\[ \boxed{f \text{ is injective but not surjective}} \]

Exercise 11 — level ★★☆☆☆

\[ f:\mathbb{R}\to(0,+\infty), \quad f(x)=e^x \]

Answer

The function is bijective.

Solution

Injectivity

As already noted, the exponential function is strictly increasing on \(\mathbb{R}\), which implies that distinct inputs yield distinct outputs.

Hence the function is injective.

Surjectivity

The codomain is \((0,+\infty)\). Let \(y>0\); we need to find \(x\) such that:

\[ y=e^x \]

Solving:

\[ x=\ln(y) \]

Since the natural logarithm is defined for every \(y>0\), every element of the codomain is the image of some \(x\).

The function is surjective.

Conclusion

\[ \boxed{f \text{ is bijective}} \]

Exercise 12 — level ★★☆☆☆

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

Answer

The function is bijective.

Solution

Injectivity

The natural logarithm is strictly increasing on its domain \((0,+\infty)\), so distinct inputs produce distinct outputs.

The function is injective.

Surjectivity

Let \(y\in\mathbb{R}\). Consider:

\[ y=\ln(x) \]

Solving:

\[ x=e^y \]

Since \(e^y>0\), there is always a value in the domain whose image is \(y\).

Hence the function is surjective.

Conclusion

\[ \boxed{f \text{ is bijective}} \]

Exercise 13 — level ★★★☆☆

\[ f:[0,+\infty)\to\mathbb{R}, \quad f(x)=\sqrt{x} \]

Answer

Injective but not surjective.

Solution

Injectivity

The square root function is increasing on \([0,+\infty)\), so distinct inputs yield distinct outputs.

It is therefore injective.

Surjectivity

We have:

\[ \sqrt{x} \ge 0 \]

So the range is \([0,+\infty)\), which does not coincide with \(\mathbb{R}\).

Negative numbers are never attained, so the function is not surjective.

Conclusion

\[ \boxed{f \text{ is injective but not surjective}} \]

Exercise 14 — level ★★★☆☆

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

Answer

Surjective but not injective.

Solution

Injectivity

The function is not monotone on all of \(\mathbb{R}\). For instance, there exist distinct values with the same image (the graph has an "S"-shaped profile).

Hence the function is not injective.

Surjectivity

Being a polynomial of odd degree, we have:

\[ \lim_{x\to+\infty}f(x)=+\infty, \qquad \lim_{x\to-\infty}f(x)=-\infty \]

Moreover the function is continuous, so by the Intermediate Value Theorem it attains every real value.

It is therefore surjective.

Conclusion

\[ \boxed{f \text{ is surjective but not injective}} \]

Exercise 15 — level ★★★☆☆

\[ f:\mathbb{R}\to\mathbb{R}, \quad f(x)=ax+1 \]

Answer

Bijective if and only if \(a\neq 0\).

Solution

Injectivity

Suppose:

\[ ax_1+1=ax_2+1 \implies ax_1=ax_2 \]

If \(a\neq 0\), dividing gives \(x_1=x_2\), so the function is injective. If \(a=0\), the function is constant and therefore not injective.

Surjectivity

Solving \(y=ax+1\):

\[ x=\frac{y-1}{a} \]

This solution exists for every \(y\) only when \(a\neq 0\).

Conclusion

\[ \boxed{f \text{ is bijective} \iff a\neq 0} \]

Exercise 16 — level ★★★☆☆

\[ f:\mathbb{R}\to\mathbb{R}, \quad f(x)=x^2+ax \]

Answer

Never injective on \(\mathbb{R}\).

Solution

Injectivity

This is a degree-two polynomial whose graph is a parabola, hence it is not monotone on all of \(\mathbb{R}\).

Consequently, there always exist two distinct inputs with the same output.

The function is not injective for any value of \(a\).

Conclusion

\[ \boxed{f \text{ is never injective}} \]

Exercise 17 — level ★★★☆☆

\[ f:\mathbb{R}\setminus\{1\}\to\mathbb{R}, \quad f(x)=\frac{1}{x-1} \]

Answer

Injective but not surjective.

Solution

Injectivity

Suppose:

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

It follows that:

\[ x_1-1=x_2-1 \implies x_1=x_2 \]

Hence the function is injective.

Surjectivity

The function never takes the value \(0\), since a fraction with numerator \(1\) cannot equal zero.

Therefore:

\[ 0 \notin \operatorname{Im}(f) \]

The function is not surjective on \(\mathbb{R}\).

Conclusion

\[ \boxed{f \text{ is injective but not surjective}} \]

Exercise 18 — level ★★★☆☆

\[ f:\mathbb{R}\to\mathbb{R}, \quad f(x)=\arctan(x) \]

Result

Injective but not surjective.

Solution

Injectivity

The function \(\arctan(x)\) is strictly increasing on all of \(\mathbb{R}\). Therefore, distinct values in the domain have distinct images.

Hence, the function is injective.

Surjectivity

The image of the function is:

\[ \operatorname{Im}(f)=\left(-\frac{\pi}{2},\,\frac{\pi}{2}\right) \]

This interval does not coincide with the codomain \(\mathbb{R}\). For example, \(\pi\) is not the image of any real number.

Hence, the function is not surjective.

Conclusion

\[ \boxed{f \text{ is injective but not surjective}} \]

Exercise 19 — level ★★★☆☆

\[ f:A\to B,\quad A=\{1,2,3,4\},\quad B=\{a,b,c\} \] \[ f(1)=a,\quad f(2)=b,\quad f(3)=c,\quad f(4)=a \]

Answer

Surjective but not injective.

Solution

Injectivity

We observe that:

\[ f(1)=a,\qquad f(4)=a \]

with \(1\neq 4\), so the function is not injective.

Surjectivity

Every element of \(B\) is the image of at least one element of \(A\):

\[ a,b,c \in \operatorname{Im}(f) \]

Hence the function is surjective.

Conclusion

\[ \boxed{f \text{ is surjective but not injective}} \]

Exercise 20 — level ★★★★☆

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

Answer

Surjective but not injective.

Solution

Injectivity

The function is not monotone on all of \(\mathbb{R}\); it has both a local maximum and a local minimum, so there exist distinct inputs with the same output.

It is therefore not injective.

Surjectivity

Being a polynomial of odd degree, we have:

\[ \lim_{x\to+\infty}f(x)=+\infty,\quad \lim_{x\to-\infty}f(x)=-\infty \]

By continuity, the function attains every real value.

Conclusion

\[ \boxed{f \text{ is surjective but not injective}} \]

Exercise 21 — level ★★★★☆

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

Answer

Neither injective nor surjective.

Solution

Injectivity

The function is not monotone on all of \(\mathbb{R}\) (it increases then decreases), so there exist distinct inputs with the same output.

Surjectivity

One can verify that:

\[ -\frac{1}{2} \le f(x) \le \frac{1}{2} \]

so the range is a bounded interval and does not coincide with \(\mathbb{R}\).

Conclusion

\[ \boxed{f \text{ is neither injective nor surjective}} \]

Exercise 22 — level ★★★★☆

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

Answer

Neither injective nor surjective.

Solution

Injectivity

Since \(x^2\) is an even function, we have:

\[ f(x)=f(-x) \]

with \(x\neq -x\) (for \(x\neq 0\)), so the function is not injective.

Surjectivity

We have:

\[ x^2+1 \ge 1 \implies \ln(x^2+1) \ge 0 \]

Therefore:

\[ \operatorname{Im}(f)=[0,+\infty) \]

Negative values are never attained.

Conclusion

\[ \boxed{f \text{ is neither injective nor surjective}} \]

Exercise 23 — level ★★★★☆

\[ f:\mathbb{R}\to\mathbb{R}, \quad f(x)=e^x+x \]

Answer

The function is bijective.

Solution

Injectivity

The sum of two strictly increasing functions is again strictly increasing. Since both \(e^x\) and \(x\) are strictly increasing, \(f(x)\) is strictly increasing too.

Surjectivity

We have:

\[ \lim_{x\to+\infty}f(x)=+\infty,\quad \lim_{x\to-\infty}f(x)=-\infty \]

Being continuous with opposite limiting behaviour, the function attains every real value.

Conclusion

\[ \boxed{f \text{ is bijective}} \]


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