TITLE: Why is $\sqrt{x}$ a function?
QUESTION [5 upvotes]: How $\sqrt{x}$ can be a function when $\sqrt{4}$ is equal to $-2$ and $2$?

REPLY [17 votes]: The notation $\sqrt{x}$ refers to the principal square root of $x$.  The principal square root is the non-negative square root.  The notation $-\sqrt{x}$ refers to the negative square root of $x$.
Hence, 
\begin{align*}
\sqrt{4} & = 2\\
-\sqrt{4} & = -2
\end{align*}
The function $f(x) = \sqrt{x}$ has domain $[0, \infty)$ and range $[0, \infty)$.  Its graph is the upper half of the parabola $x = y^2$.  
The function $g(x) = -\sqrt{x}$ also has domain $[0, \infty)$, but its range is $(-\infty, 0]$.  Its graph is the lower half of the parabola $x = y^2$.  
See the diagram below.