Is sqrt(x) a function? Does it matter if a domain is given? 
Possible Duplicates:
Reason why the even root of a number always positive
Square roots — positive and negative 

I saw the following during a practice exam:

$f(x) = \sqrt x $ for $x ≥ 2$

After the exam, I pointed out to my teacher that this was not actually a function, but instead a mapping, because it can have both positive and negative values. She told me that this didn't matter; you assume the answer of $\sqrt x$ to be positive, unless otherwise stated. However, this contradicts her previous statement that $\sqrt x$ is a mapping. (She gave it as an example of something that was not a function, when defining functions.)
So, is $f(x)$ a function? Does it matter if there is a domain restriction?
 A: The specification of a function is never complete unless you give its domain and range. The rule alone is insufficient.
A: By convention $\sqrt{x}$ unambiguously denotes the non-negative square root of $x$, so ‘$f(x) = \sqrt{x}\text{ for }x \ge 2$’ does describe a function. 
However, unless you’ve misunderstood her, your teacher is using the term mapping incorrectly. It has a slightly different meanings for different people in different contexts, but in your apparent context I’d expect them to be synonymous, and I’d certainly expect every mapping to be a function. The relation $R$ consisting of all ordered pairs $(x^2,x)$ such that $x$ is a real number is an example of a relation that is not a function, since distinct pairs in $R$ can have the same first component, but it’s not a mapping in any common terminology with which I’m familiar.
A: You can easily define a function $f : \mathbb R \to \mathbb R$ to output for each $x$ the positive square root of $x$. You can also have a function from $\mathbb R \to \mathbb R \times \mathbb R$ defined by $f(x) = (\sqrt{x}, -\sqrt{x})$, where $\sqrt{x}$ is the positive square root of $x$ (with $x \ge 2$ if you wish).
By the way, for most authors in most theories, a mapping and a function is the same, same thing. No difference. To be honest, for me there is no difference. I don't call a mapping a "function which can output more than one value". I'd rather not give those things a name since we don't use them very often in mathematics, we stick to functions almost all the time.
In general, you should not argue in the meaning of words if the context is well-understood and that you don't have any problem with it. Words are meant for comprehension and clarity, so if you understand and it's clear to everyone, there's no need to argue. I think your teacher clearly meant the positive square root because everyone does think that way, it's a convention. Although it's good to ask yourself what's going on and wonder why things are as they are. What I meant is : don't think your teacher is bad because he wasn't clear to you or something.
Hope that helps,
A: There are a few things going on here.  First a function is the data of two sets $A$ and $B$, and an assignment $a\mapsto f(a)\in B$ for every $a\in A$.  Having a domain and codomain is very important when dealing with general functions, but people are usually lazy when dealing with functions defined on (most of) $\mathbb{R}$.  Given a function $f:A\to B$ and a subset $A'\subset A$, we can restrict $f$ to $A'$.  Additionally, if $B\subset B'$, we can compose $f$ with the inclusion $i:B\to B'$ to get a function $i\circ f$.  Every function can be written as the composition of a surjective function (namely shrinking the codomain of the function to be the image of the function) followed by an inclusion.
Second, given a function, $f:A\to B$, the inverse is a function $g:B\to A$ such that $f(g(b))=b$ for all $b\in B$ and $g(f(a))=a$ for all $a\in A$.  Not every function has an inverse: it must be both injective (if $x\neq y$, then $f(x)\neq f(y)$), and surjective (if $b\in B$, then we can find $a\in A$ with $f(a)=b$).  In this case, the inverse is easy to define: if $f(a)=b$, we define $g(b)=a$.  Because of surjectivity, we have a value of $g(b)$ for every $b$.  Because of injectivity, we have only one value.  Therefore, this defines a function.
When we look at $f(x)=x^2$, with $f:\mathbb{R}\to \mathbb{R}$ we see that it is neither injective nor surjective.  However, if we restrict both the domain and codomain, and view it as a function $f:\mathbb{R}_+\to \mathbb{R}_+$, then it is both injective and surjective, and so we have an inverse function, namely the square root function.
However, $\sqrt{x}$ is not the only thing that squares to $x$, as $(-\sqrt x)^2=x$.  This was why we needed to restrict the squaring function before we could take an inverse: sending $x$ to all things which square to $x$ is NOT a function.
Of course, there are things more general than functions, "multi-valued functions," which take multiple values, and you can construct a normal function from a multi-valued function by choosing one value at every point.  In this case, $\sqrt{x}$ and $-\sqrt{x}$ are both branches of a multivalued function defining the inverse to the squaring function.  However, multi-valued functions are difficult to work with, and I don't recommend that you give them much thought until you have to (e.g. in a class on complex analysis).
