Is this function injective and surjective? Let $f(x)=x^2$. Is this function injective and surjective if the function is defined as:


*

*$f: \mathbb{R} \longrightarrow [0,\infty)$.

*$f: \mathbb{C} \longrightarrow \mathbb{C}$.

*$f: \mathbb{R} \longrightarrow \mathbb{R}$.

*$f: \mathbb{R} \cup \{x \in \mathbb{C} : \mathrm{Re}(x) = 0\} \longrightarrow \mathbb{R}$.

*$f: \{z=x+iy: i^2=-1, y>0\} \cup \{z=x+iy: i^2=-1, y=0 \text{ and } x \ge 0\} \longrightarrow \mathbb{C}$.
Thanks!
 A: First you should understand the definition of injective and surjective. 
A function $f:A\rightarrow B$ is a map on sets that assigns every element of $A$ to an element of $B$. We actually call $B$ the codomain and $A$ the domain. $B$ is usually mistaken as the range, but the range, which we can denote as $f(A)$ is the set of elements of $B$ that actually have a preimage in $A$, (ie. For every $b\in f(A)$, there exists an element $a\in A$ such that $f(a)=b$). 
$f$ is called onto/surjective, if $B$ equals the range of $f$. It is called one-to-one/injective, if $f(x)=f(y)$ implies $x=y$. When $f$ is injective and surjective, it is called a bijection. In this case we can invert $f$, and define $f^{-1}:B\rightarrow A$, by sending $b\in B$ to its preimage under $f$. It then follows that $(f^{-1}\circ f)(a)=a$ and $(f\circ f^{-1})(b)=b$. 
Now to answer your specific question:
1) $f$ is not injective (Sigur explained why) but is surjective (every non-negative real number has a real square root).
2) $f$ is not injective (for the same reason as 1), but is surjective (every complex number has a square root).
3) $f$ is neither injective nor surjective (The image is $[0,\infty)$).
4) $f$ is again not injective, but is surjective (since the square root of the negative reals lies on the imaginary axis).
5) $f$ is injective and surjective (and hence a bijection). It is easiest to see this by writing an element of the domain in polar coordinates and observing that applying $f$ has the effect of doubling it's angle from the positive real axis.
