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!