I am trying to show the following:
Let $g$ be a continuous function of a domain $D \subseteq \mathbb{C}$. Suppose that $f$ has this property: for each point $z \in D$, there is a disc $C$ centered at $z$ on which $g$ is constant. Conclude that $g$ is constant throughout $D$.
Here domain means nonempty, open, and connected and connected means that there is a polygonal line contained in the set which connects any two points. My strategy goes as follows:
Let $p_{1}$ and $p_{2}$ be two distinct points of $D$. Then showing $g(p_{1}) = g(p_{2})$ completes the proof. Since $D$ is a domain, there is a polygonal line connecting them contained entirely in $D$ and it suffices to show that they are joined by a single line segment (because the case where there are additional line segments can be handled by induction). So we know that there exists a disk $C_{p_{1}}$ centered at $p_{1}$ on which $g$ is constant. We can recover this disk to a sub-disk $C_{p_{1}}'$ which is centered at $p_{1}$ and contained entirely in $D$. Now from here I can choose a point $q_{1} \in C_{p_{1}}'$ that is ''closest'' to $p_{2}$ (since $C_{p_{1}}'$ is closed) and then repeat this process of finding neighborhoods contained in $D$ on which $g$ is constant-- and equal to $g(p_{1})$-- all the while getting closer to $p_{2}$.
Here is where I am stuck. While this process certainly gets us closer to $p_{2}$, it does not necessarily ensure that there is some $q_{n}$ for which the disk centered at $q_{n}$ on which $g$ is constant contains $p_{2}$. I believe that this does follow from continuity, but I am unsure how to use that hypothesis to move my disks far enough along to contain $p_{2}$.
This follows from rather general properties of topological spaces and continuous functions.
Assume $g \colon D \to X$ is as above, where $X$ is a topological space in which points are closed, e.g. $\mathbb{R}$ or $\mathbb{C}$. Let $p \in D$ and $r := g(p)$.
Now $\{r \} \subset X$ is a closed subset, so $p^{-1}(r)$ is a closed subset of $D$. By the assumption above every point in $p^{-1}(r)$ has an open neighborhood contained in $D$, so this subset is also open. Thus $p^{-1}(r)$ is a connected component of $D$, and since $D$ is connected that implies $p^{-1}(r) = D$.