if a function all have exactly one output per input, then how come $f(x)= \sqrt{x}$ is a function? assuming $f: \mathbb R \rightarrow \mathbb R$. When $f(-1)$ it outputs a complex number and is not part of the codomain, this is really confusing me.
My second confusion is f$(x)=1/x$, call it $g: \mathbb R \rightarrow \mathbb R$. When $x = 0$, it doesn't output a something in the co-domain since $1/0$ is undefined. So it must not be a function? Or is it I don't know. Pardon my English thank you.