Why is the negative real axis described by $z\le 0$ (shouldn't it be $x\le 0$?)
Whenever a complex number appears in an inequality, the inequality implicitly says that the number is real. Hence, $z\le 0$ is indeed the negative real axis. The inequality $x\le 0$, on the other hand, would be understood as describing the left half-plane (since it does not say anything about $y$).
Isn't it always the case that one value of $\sqrt{z}$ has a positive real part
True (if "positive" means $\ge 0$). But after removing the negative semiaxes we can say the same, but with "positive" being $>0$. The difference is substantial. Strict inequalities are stable under small perturbations; thus, choosing the root with positive real part gives us a continuous function.
And why does $w=\sqrt{z}$ become a single-valued function, when we restrict the domain but not the range?
The range is determined by the domain. Whenever we talk about the restriction of some function, it's the domain that is being restricted.
There are still two values of square root to choose from, but it's now possible to make the choice continuously, (and, consequently, in a holomorphic way).
This is essentially the open mapping theorem, which states that a holomorphic, non-constant function is always an open map(i.e. it sends open subsets of its domain to open subsets of $\mathbb{C}$).
Now, the reals are a closed subset of $\mathbb{C}$, so if you have a holomorphic map $f: U \to \mathbb{R}$, where $U$ is open and connected, that map is constant; if it wasn't, $f(U)$ should be open in $\mathbb{C}$.
If we drop the assumption that $U$ is connected, then the map is constant at each component of $U$, but those values may be different for each component.
Best Answer
This isn 't an answer to your question, but rather an answer to your problem.
Let $f$ be an holomorphic function on a connected set $G$.
There exist functions $u,v$ such that $f=u+iv$.
Now using Daniel Fischer's hint, since $f$ is holomorphic, $u_x=v_y$ and $u_y=-v_x$. By hypothesis $\text{im}(f)\subseteq \Bbb R$, therefore $v=\textbf 0$ and it follows that $u_x=\textbf 0= v_x$.
Finally use the $f'=u_x+iv_x$ and the fact that $G$ is connected to conclude. (This is used in the last step).