Consider a simple case:
Let $f$ be a function from $\textbf{R}^+$ to $\textbf{R}$, such that $f(x) = \sqrt{x}$.
It is known that a positive real number can have two square roots. A basic case: $\sqrt{4} = \{+2, -2\}$. However, this goes against the very definition of a function:
"a function is a binary relation between two sets that associates every element of the first set to exactly one element of the second set." (Source: wikipedia)
What am I missing?