Is $f(x)=\pm\sqrt x$ a function? The solution is either that it is not a function or it is only when $x=0$, I don't know which.
 A: A function $f : X \to Y$ defined between a set $X$ and the set $Y$ associate to $x \in X$ a corresponding unique $y=f(x)$ in the codomain $Y$.
So one question you must ask yourself is on what sets do you want to define $f(x)=\pm\sqrt x$? If you want to associate to a positive real a unique real, then you have an issue... However you can define
$$\begin{array}{l|rcl}
g : & \mathbb R_+ & \longrightarrow & \mathbb R \times \mathbb R \\
    & x & \longmapsto & (\sqrt{x},-\sqrt{x}) \end{array}$$
Conclusion. If you want to define your function from real subsets to reals subsets, then as you noticed, the only possible subset is $\{0\}$ to associate to a unique value a unique value. The $g$ I defined above associate to a unique non negative real a unique COUPLE which can be an answer to your question.
A: A function is a mapping (lets call it $f$) from one set (let's call it $A$) to another set (let's call it $B$) so that each element, $x \in A$ is mapped to precisely one (not two, not zero) element $f(x) = y \in B$.
In this case $f$ maps $\mathbb R^+$ to $\mathbb R$ (we can write that as $f:\mathbb R^+ \rightarrow \mathbb R$. So that $f(x) = \sqrt{x}$ and $f(x)=-\sqrt{x}$.  This is not a mapping that maps every $x$ to precisely one value; it maps most values to two values.
So it is not a function...
If the domain is $R^+$.  If the mapping has a different domain, it could be a function.  If the domain is $A = \{0\}$ then $f$ does map the one and only element of $\{0\}$ to precisely one value.  $f:\{0\}\rightarrow \{0\}$ and $f(x)= f(0) = \pm \sqrt{0} = \pm 0 = 0$ and that is a distinct value.  So technically it is a function.
