Confusion about injective, surjective, bijective As an example, I'm looking at $\sqrt{-x}$ for real $x.$ It's defined on the interval $(-\infty,0]$ and its inverse is defined on the interval $[0,\infty).$
Over which interval is this function injective, surjective and bijective?
If the domain is $(-\infty,0]$ then over this interval, it is injective because every real number in $(\infty,0]$ is mapped to at most one element in $\mathbb{R}$?
I'm confused about where this function is surjective, and if it's bijective at all.
The domain of this function's inverse is $[0,\infty).$ Does that mean the function is invertible over $[0,\infty)$?
 A: *

*You're correct that it's injective but your justification is hazy. It is injective because every real in $(-\infty,0]$, the domain, is mapped to a point in the codomain $[0,\infty)$ that is unique to the input (read: no two distinct elements of the domain are mapped to the same element in the codomain). You wrote: "It is mapped to at most one ..." but any function whatsoever will map elements in the domain to exactly one element in the codomain.

*The function has an inverse, so it is indeed invertible. It's not clear what: 'over' should mean. If you have a function $f:X\to X$ that is invertible, it makes sense to say it is invertible over $X$. But the codomain is not equal to the domain, be careful; it is invertible as a function between $(-\infty,0]$ and $[0,\infty)$.

The function surjects onto the given codomain, because if you give me $y\in[0,\infty)$ I can create $x:=-y^2$, such that $\sqrt{-x}=y$.
A: The function $y=\sqrt{-x}$ is defined, as you rightly say, on the domain $\{x\leq0\}$  and takes values in $\{x\geq0\}$ because square roots are always non-negative by convention.
Now note that you can define on $\{x\geq0\}$ the function $x=-y^2$ and observe that the two functions are inverse of each other. Indeed their domains/codomains are interchanged and
$$
-(\sqrt{-x})^2=-x\qquad \sqrt{-(-y^2)}=y.
$$
Thus both functions must be bijective (i.e. injective and surjective) since being invertible and being bijective are equivalent conditions.
