# Are all functions that have an inverse bijective functions?

To have an inverse, a function must be injective i.e one-one.

Now, I believe the function must be surjective i.e. onto, to have an inverse, since if it is not surjective, the function's inverse's domain will have some elements left out which are not mapped to any element in the range of the function's inverse.

So is it true that all functions that have an inverse must be bijective?

Thank you.

• You can accept an answer to finalize the question to show that it is done. Apr 1, 2015 at 5:45
• A function has an inverse if and only if it is bijective. Apr 1, 2015 at 11:44
• In summary, if you have an injective function $f: A \to B$, just make the codomain $B$ the range of the function so you can say "yes $f$ maps $A$ onto $B$". I don't think anyone would dispute that $e^x$ has an inverse function, even though the function doesn't map the reals onto the reals. Just make the codomain the positive reals and you can say "$e^x$ maps the reals onto the positive reals". So $e^x$ is both injective and surjective from this perspective. I originally thought the answer to this question was no, but the answers given below seem to take this summarized point of view Sep 8, 2018 at 14:59

All the answers point to yes, but you need to be careful as what you mean by inverse (of course, mathematics always requires thinking). I will try not to get into set-theoretic issues and appeal to your intuition.

If $f : X \to Y$ is a map of sets which is injective, then for each $x \in X$, we have an element $y = f(x)$ uniquely determined by $x$, so we can define $g : Y \to X$ by sending those $y \in f(X)$ to that element $x$ for which $f(x) = y$, and the fact that $f$ is injective will show that $g$ will be well-defined ; for those $y \in Y \backslash f(X)$, just send them wherever you want (this would require this axiom of choice, but let's not worry about that). The function $g$ satisfies $g(f(x)) = g(y) = x$, so that $g \circ f$ is the identity map ; that is, $f$ admits a left inverse.

Conversely, suppose $f$ admits a left inverse $g$, and assume $f(x_1) = f(x_2)$. Then $x_1 = g(f(x_1)) = g(f(x_2)) = x_2$, so $f$ is injective. That is,

A function $f : X \to Y$ is injective if and only if it admits a left-inverse $g : Y \to X$ such that $g \circ f = \mathrm{id}_X$.

Similarly, it is not hard to show that $f$ is surjective if and only if it has a right inverse, that is, a function $g : Y \to X$ with $f \circ g = \mathrm{id}_Y$. I'll let you ponder on this one.

If you're looking for a little more fun, feel free to look at this ; it is a bit harder though, but again if you don't worry about the foundations of set theory you can still get some good intuition out of it.

Hope that helps,

If $f\colon A \to B$ has an inverse $g\colon B \to A$, then \begin{align*} (g \circ f)(x) & = x~\text{for each}~x \in A\\ (f \circ g)(x) & = x~\text{for each}~x \in B \end{align*} A function is bijective if it is both injective and surjective.

injective: The condition $(g \circ f)(x) = x$ for each $x \in A$ implies that $f$ is injective.

Suppose $(g \circ f)(x_1) = (g \circ f)(x_2)$. Then $x_1 = (g \circ f)(x_1) = (g \circ f)(x_2) = x_2$. Hence, $f$ is injective.

surjective: The condition $(f \circ g)(x) = x$ for each $x \in B$ implies that $f$ is surjective.

Let $b \in B$. Suppose that $g(b) = a$. Then $(f \circ g)(b) = f(g(b)) = f(a) = b$, so there exists $a \in A$ such that $f(a) = b$. Thus, $f$ is surjective.

Therefore, if $f\colon A \to B$ has an inverse, it is both injective and surjective, so it is bijective.

• Isn't the inverse of the element which is not mapped to just the empty set? Jun 23, 2021 at 22:50
• @Larry The second part of the proof shows that every element in $B$ is the image of some element of $A$, so there are no such elements. Jun 23, 2021 at 23:20

Yep, it must be surjective, for the reasons you describe. It must also be injective, because if $f(x_1) = f(x_2) = y$ for $x_1 \ne x_2$, where does $f^{-1}$ send $y$?

I won't bore you much by using the terms injective, surjective and bijective. Let's keep it simple - a function is a machine which gives a definite output to a given input Let's say a function (our machine) can state the physical state of a substance. Lets denote it with S(x). Now when we put water into it, it displays "liquid".Put sand into it and it displays "solid". Put milk into it and it again states "liquid" So is it a function? - Yes because it gives only one output for any input. Let's make this machine work the other way round. Until now we were considering S(some matter)=the physical state of the matter Now we want a machine that does the opposite. That means we want the inverse of S. Therefore what we want the machine to give us the stuffs which are of the state that we chose.....too confusing? Let me put it this way.... When we opt for "liquid", we want our machine to give us milk and water. But if for a given input there exists multiple outputs, then will the machine be a function? No - it will just be a relation on the matters to the physical state of the matter. Therefore inverse of a function is not possible if there can me multiple inputs to get the same output.

Let's again consider our machine S(some matter)=it's state Now we have matters like sand, milk and air. One by one we will put it in our machine to get our required state. Now for sand it gives solid ;for milk it will give liquid and for air it gives gas. That was pretty simple, wasn't it? Only this time there is a little twist......Our machine has gone through some expensive research and development and now has the capability to identify even the plasma state (like electric spark)!! So if we consider our machine to be working in the opposite way, we should get milk when we chose liquid; Sand when we chose solid ; air when we chose gas....... And when we choose plasma it should give........nah - it won't be able to give anything because there was no previous input that was in the plasma state......but a function should have an output for the inputs that we have defined in the domain.......again too confusing?? If we didn't originally provide a substance in the plasma state, how can we expect to get one when we ask for it! Would you get any money from someone who is not indebted to you?? Obviously no! So the inverse of our machine or function is not possible because the state which was left out originally had no substance in the domain and as inverse traces us back to the domain.......Our output for plasma doesn't exist Hence it's not a function

That's it! Hope I was able to get my point across.

• Please use Mathjax... and also, Make the body of the answer more clear... Jun 30, 2017 at 18:10
• Your answer explains why a function that has an inverse must be injective but not why it has to be surjective as well. Jun 30, 2017 at 18:15
• Thanks for the suggestions and pointing out my mistakes Jun 30, 2017 at 18:19
• As far as surjection is concerned , Jun 30, 2017 at 18:19

Yes. Think about the definition of a continuous mapping.

Let $f:X\to Y$ be a function between two spaces. Topologically, a continuous mapping of $f$ is if $f^{-1}(G)$ is open in $X$ whenever $G$ is open in $Y$. In basic terms, this means that if you have $f:X\to Y$ to be continuous, then $f^{-1}:Y\to X$ has to also be continuous, putting it into one-to-one correspondence.

Thus, all functions that have an inverse must be bijective.

• You seem to be saying that if a function is continuous then it implies its inverse is continuous. This is wrong. Jan 21, 2017 at 22:15
• -1 this has nothing to do with the question (continuous???) Sep 9, 2018 at 18:06

Yes. A function is invertible if and only if the function is bijective.

For a pairing between X and Y (where Y need not be different from X) to be a bijection, four properties must hold:

(1) Each element of X must be paired with at least one element of Y,
(2) No element of X may be paired with more than one element of Y,
(3) Each element of Y must be paired with at least one element of X, and
(4) No element of Y may be paired with more than one element of X.


A bijection f with domain X (indicated by f: X → Y in functional notation) also defines a relation starting in Y and going to X. Properties (3) and (4) of a bijection say that this inverse relation is a function with domain Y. Moreover, properties (1) and (2) then say that this inverse function is a surjection and an injection, that is, the inverse function exists and is also a bijection.

The 'counterexample' given in the other answer, i.e. $f: X \to Y$ via $f(x) = \frac{1}{x}$ which maps $\mathbb{R} - \{0\} \to \mathbb{R} - \{0\}$ is actually bijective.

Let $f(x_1) = f(x_2) \implies \frac{1}{x_1} = \frac{1}{x_2}$, then it follows that $x_1 = x_2$, so f is injective.

Let $x = \frac{1}{y}$. Then, $\forall \ y \in Y, f(x) = \frac{1}{\frac{1}{y}} = y$. So f is surjective.

The claim that every function with an inverse is bijective is false. A simple counter-example is $f(x)=1/x$, which has an inverse but is not bijective. $f$ is not bijective because although it is one-to-one, it is not onto (due to the number $0$ being missing from its range).

• To be able to claim that you need to tell me what the value $f(0)$ is. Dec 11, 2017 at 2:04
• @percusse $0$ is not part of the domain and $f(0)$ is undefined. What's your point? Dec 11, 2017 at 5:52
• @MarredCheese but can you actually say that $\mathbb R$ is the codomain, rather than $\mathbb R \backslash \{0\}$? If we can point at any superset including the range and call it a codomain, then many functions from the reals can be "made" non-bijective by postulating that the codomain is $\mathbb R \cup \{\top\}$, for example. Feb 28, 2018 at 11:17
• @DawidK Sure, you can say that ${\Bbb R}$ is the codomain. For instance, if I ask Wolfram Alpha "is 1/x surjective," it replies, "$1/x$ is not surjective onto ${\Bbb R}$." However, I do understand your point. By the same logic, we can reduce any function's codomain to its range to force it to be surjective. It seems like the unfortunate conclusion is that terms like surjective and bijective are meaningless unless the domain and codomain are clearly specified. Feb 28, 2018 at 16:46