My test book says that $y=\sqrt{x}, x\in\ \Bbb R$ is not a function because x values less than zero are not mapped onto anything, and that it can be made into a function by restricting the domain to $x\in \Bbb R, x\geqslant 0$.
I was wondering if you could make it into a function by changing the range instead, to $y=\sqrt{x}, x\in \Bbb R, y\in \Bbb C\;?$
Then each element of the domain does have an output...
[NOTE: I am also unsure about the distinction between range and codomain. I think- though I really am not sure- that the term codomain should be used here instead, and the range is smaller than the codomain because the possible outputs exist solely on the real axis or imaginary axis, but not elsewhere on the complex plane?]