# Determining If A Relation Is A Function

I am given the simple relation $f(x)=\sqrt{x}$, where $f$ maps $R \rightarrow R$, and I am suppose to determine whether or not it is a function.

I figured that it was a function, because in the definition of a function it doesn't mention anything about not being defined at a value. Clearly, this function isn't onto though, because any value in the codomain that is less than $0$ won't be assigned to a domain value.

-
For a relation to be a function, every point in domain must be related to a single point in co-domain. And you can map only $\Bbb R^+\cup\{0\}$ to domain under this relation. –  Aang Mar 7 '13 at 13:34
@Avatar And because every domain value can't be mapped to some co-domain value, it isn't a function? –  Mack Mar 7 '13 at 14:30

A function must be defined on it's entire domain. This is false here, so $f:R \to R$ is not a function.

However if the domain was $R_{ \ge0}=[0,\infty)$, $f$ would have been a function.

-
So, do we ever have to worry about the domain? Also, here is the definition my book gives: "Let $A$ and $B$ be nonempty sets. A function $f$ from $A$ to $B$ is an assignment of exactly one element of $B$ to each element of $A$. We write $f(a)=b,$ if $b$ is a unique element of $B$ assigned by the function $f$ to the element $a$ of $A$." What are the key words in the definition that would make me think that the entire range has to be defined? –  Mack Mar 7 '13 at 13:37
"....would be a function"...**if** we make the agreement of taking the positive (or negative) root, otherwise it is not a function. –  DonAntonio Mar 7 '13 at 13:38
@EliMackenzie "to each element of A..." the negative real numbers make this requirement fail. –  user1337 Mar 7 '13 at 13:40
@MichaelTouitou With the restricted domain in your answer, it would be a function but still not onto? –  Mack Mar 7 '13 at 13:46
That is correct. –  user1337 Mar 7 '13 at 13:50