# Should the invertible functions be bijective?

I see that in some websites like Wikipedia, and even in some answers given in this site, they affirm that an invertible function must necessarily be bijective. But reviewing the book The Calculus by Louis Leithold, it is only necessary that the function be one-to-one. I have this example:

Let $f$ be $f:\mathbf{R}^+ \cup$ {$0$} $\to\mathbf{R}$, $f(x) = x^2$,

and $g$ be $g(x) = \sqrt x$ with its natural domain.

$f$ and $g$ are one-to-one. The image of $f$ is not all its codomain, since it's only $\mathbf{R}^+ \cup$ {$0$}, then it is not onto. Of course, if we had defined it as $f:\mathbf{R}^+ \cup$ {$0$} $\to\mathbf{R}^+ \cup$ {$0$}, the function would have been bijective, but we would be forcing the target set to be equal to the image, so we would be forcing the surjectivity.

Now, the domain of $g$ is not all the target set of $f$, only its image, but I don't know if there is a conceptual problem with this. Apart from this, it is obvious that one function undoes the effect of the other for every element of their domains, so they should be mutually inverse.

• But $g (25)=|5|=\pm 5$ – Archis Welankar Sep 9 '17 at 4:24
• The absolute value has only one possible result for a specific number. If $x$ is positive like in this case, then $|x| = x$, so $|5| = 5$. – Ronald Becerra Sep 9 '17 at 4:26
• You can impose a condition like$f: R^+\to R^+$ so that its one-to-one function. – Archis Welankar Sep 9 '17 at 4:32
• @ArchisWelankar: If $x$ is negative, then $|x| = -x$ so $|-5| = -(-5) = 5$ – Ronald Becerra Sep 9 '17 at 4:41
• @RonaldBecerra another condition of a function is that it must have an output for every input in the domain. You'd have to restrict the codomain to the non-negative reals as you've done tacitly by restricting to the principal square root. In that case it is invertible, but also bijective. – CyclotomicField Sep 9 '17 at 4:41

Generally speaking, you can always say that a function is surjective onto its image. Given $f:A \to B$, we can view $f$ as a surjective function $f:A\to f(A)$. Therefore, if $f:A\to B$ is injective, then $f:A\to f(A)$ is bijective, and therefore invertible, which means that there is some $g:f(A) \subseteq B \to A$ such that $f(g(x)) = x$ for all $x \in f(A)$ and $g(f(y)) = y$ for all $y\in A$.
In this case we view both $f(x) = x^2$ and $g(x) = \sqrt{x}$ as functions $\mathbb{R}^+ \cup \{0\} \to \mathbb{R}^+ \cup \{0\}$.