My discrete mathematics book has the following problem:

22. Determine whether each of these functions is a bijection from $\mathbb{R} \to \mathbb{R}.$

c) $f (x) = \frac{x + 1}{x + 2}$

Since one element of the domain doesn't have an image, namely when $x = -2$, is $f(x) = \frac{x + 1}{x + 2}$ even a function?

  • $\begingroup$ We can define its domain to not include that point. Does your book have another example that is similar that is worked out? $\endgroup$
    – abiessu
    Oct 15, 2015 at 0:10
  • 1
    $\begingroup$ A function is a special relationship where each input has a single output. It does not have to be continuous for all points. if you can find at least 1 point where $f(x1)= v1$ and $f(x1)=v2$ where $v1$ is not equal to $v2$, then the relation is not a function. $\endgroup$
    – NoChance
    Oct 15, 2015 at 0:27
  • 6
    $\begingroup$ But a bijection from R to R must be defined on every R (this isn't) and every y in R must be y = f(x) for some x. This isn't a bijection from R to R. But it is a function. A function of a subset of R to a subset of R. $\endgroup$
    – fleablood
    Oct 15, 2015 at 0:35
  • $\begingroup$ Which discrete mathematics book? $\endgroup$ Aug 14, 2022 at 13:53
  • $\begingroup$ @RodrigodeAzevedo Please don't make nonsubstantive edits to old questions. That moves them to the active queue, which wastes the time of folks like me who watch that queue for new things. $\endgroup$ Aug 14, 2022 at 13:56

2 Answers 2


The mapping you specify cannot be a function $\mathbb{R}\rightarrow\mathbb{R}$ since is it not defined for $x=-2$ It is injective on its domain but not onto since the equation $f(x) = 1$ is insoluable. It is, however a bijection from $\mathbb{R}-\{2\}$ to $\mathbb{R}-\{1\}$.

Specification of a function must include a domain and codomain. This example here shows why you must do that.

  • 2
    $\begingroup$ It's still a function from f:R/{2} -> R. The OP asked if it was "even a function". The answer is yes. Just not on all of R. $\endgroup$
    – fleablood
    Oct 15, 2015 at 0:19
  • 1
    $\begingroup$ Actually, since domain and codomain are not specified, a function here has not been properly defined. $\endgroup$ Oct 15, 2015 at 0:21
  • 2
    $\begingroup$ I don't make that assumption. You must specify domain and codomain. $\endgroup$ Oct 15, 2015 at 0:23
  • 1
    $\begingroup$ f: R->R means that R is both the domain and the codomain, no? $\endgroup$ Oct 15, 2015 at 0:26
  • 3
    $\begingroup$ No. Consider the mapping $x\mapsto x^2$. This is a bijection of $[0,\infty)$ onto itself but it is not a bijection $[0,\infty)\rightarrow \mathbb{R}$. $\endgroup$ Oct 15, 2015 at 1:03

What is a function?

A popular definition, which can be directly mapped to set theory, is that a function is a set of input / output pairs. E.g.:

$f(x) = \frac{x + 1}{x + 2}$

could represent the set of pairs:

  • (-1, 0)
  • (0, 1/2)
  • (1, 2/3)

But it could also represent the set of pairs:

  • (0, 1/2)
  • (1, 2/3)
  • (2, 3/4)

Both of these are two completely different functions.

Morale: a formula like $f(x) = \frac{x + 1}{x + 2}$ is not a function.

A formula + a domain ($\mathbb{R}-\{2\}$ here) may represent a function if the formula is well defined over the domain.

But what a function really is, is the a set of pairs. You just have to come up with method that clearly describes that set of pairs.

For your specific case, you could take the domain as $\mathbb{R}-\{2\}$ and the set of points is specified.

Furthermore, you could also add a new pair (-2, 1234) to the function, and you'd have a function defined over $\mathbb{R}$.

Also worth noting: in this case we cannot make the function continuous by choosing any value at -2, but in some cases we can. E.g.:

$f(x) = \frac{x}{x}$

can be made continuous at 0 by adding the pair (0, 1).

The big advantage of such a set theoretical definition is that it can be used easily in formal proof systems: What does "formal" mean?


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .