# Why is $f:\mathbb{R^+}\to \mathbb{R}$ defined by $f(x)=x^2$ not an invertible function?

Why is $f:\mathbb{R^+}\to \mathbb{R}$ defined by $f(x)=x^2$ not an invertible function? I know the answer: because it's not onto, but what is problem with it? what does it break the invertibility?
P.s.: $\mathbb{R^+}=\{x\in \mathbb{R}|x‎\geq‎ 0\}$

• What is the definition of an invertible function? The idea of why it does not work is that for a function $f:A\to B$ to be invertible you want that every element of $B$ is mapped to an element of $A$ uniquely by the inverse of $f$. Commented May 23, 2015 at 13:54
• Does $\mathbb R$ contain only nonnegative reals? Commented May 23, 2015 at 13:55
• @LandonCarter: Yes. I edited my question. Commented May 23, 2015 at 13:58

With the given domain, $f$ is in fact one-to-one. But it is not onto the given codomain, because there is no $x$ with $f(x)=-1$. If the codomain is changed to $\mathbb{R}^+$, then $f$ is indeed invertible.

• I told myself that I know $f$ isn't onto and I do know that $f:\mathbb{R^+}\to \mathbb{R^+}$ is bijective and so invertible. My problem is that: What problem is created if the function is not onto? Suppose you want to write the answer on a final exam sheet. Commented May 23, 2015 at 14:18
• @Sisabe The domain of the inverse would be the given codomain, i.e. $\mathbb{R}$, but there is no way to define the inverse at $-1$.
– Ian
Commented May 23, 2015 at 14:38
• because $\sqrt{-1}$ is undefined. right? Commented May 23, 2015 at 14:48
• @Sisabe That's one way to say it, yes.
– Ian
Commented May 23, 2015 at 14:54

It's not surjective, for $f^{-1}$ it needs to have the entire domain $\mathbb{R}$, so what is $f^{-1}(-2)$?

There is a good explanation from wikipedia:

When using codomains, the inverse of a function $ƒ: X → Y$ is required to have domain $Y$ and codomain $X$. For the inverse to be defined on all of $Y$, every element of $Y$ must lie in the range of the function $f$. A function with this property is called onto or a surjection. Thus, a function with a codomain is invertible if and only if it is both injective (one-to-one) and surjective (onto). Such a function is called a one-to-one correspondence or a bijection, and has the property that every element $y\in Y$ corresponds to exactly one element $x \in X$.