TITLE: local constant $\Rightarrow$ global constant
QUESTION [5 upvotes]: Let $f\colon M\to\mathbb{C}$ be a holomorphic, localy constant function, $M\subseteq\mathbb{C}$ open and connected. Show, that then $f$ is constant on whole $M$.


Isn't this an easy consequence of the identity theorem, i.e:
$f$ is constant localy, i.e. there exist $x_0\in M, r>0, c\in\mathbb{C}$, so that
$$
f(x)=c~\forall~x\in B(r,x_0).
$$
So $x_0$ is a limit point of
$$
\left\{z\in M: f(z)=c\right\}
$$
and the identity theorem says that
$$
f=c~\forall~z\in M.
$$
That's it already?

REPLY [3 votes]: Just so this question has an answer, yes, that's it. 
If by locally constant you mean each point has a neighbourhood on which the function is constant, then you don't even need the function to be holomorphic. If, however, you mean there is a point with a neighbourhood on which the function is constant, then you do need holomorphicity, in particular the Identity Theorem.