It is important to note that a function always returns a unique value. Now, there are some operations that produce more than one output. For example, the square root function produces 2 outputs for every input. So, in case we want to define a 'function' for such operations, we have to define them such that they produce a single output for every input. In this particular case, we define the square root function in terms of the absolute value of the output (another function). (We'll have more to say about both these functions when we talk about piecewise functions.)
There is another way to represent this. Think of the square root as a function not as R+ -> R+, but as a function from R+ -> R+ x R-. Here R+ is the set of all positive real numbers and R- is the set of all negative real numbers. The output of the function is a
single ordered pair belonging to R+ x R-, and then sqrt has all the same characteristics as any other function.