Let $G$ be an open connected set in complex plane such that $z\in G \implies -z \in G$ . If $f$ is a holomorphic function in $G$ such that $f$ is real valued in some non-empty set $G \cap [a,b]$ for some real $a,b$ , then is it true that $f$ is real valued in $G \cap \mathbb R$ ?
I couldn't get anywhere with this problem . Please help.
There are counterexamples. Define $f(z)$ as a choice of $\sqrt{(z-1)(z-2)}$ real for $z<1$ and $z>2$ but imaginary for $1<z<2,$ given by a branch cut connectecting $1$ to $2$ via a path in the upper-right quadrant (so avoiding the real line). If we remove the points in the bottom-left quadrant corresponding to the negation of point in this branch cut, the remaining domain is an open connected set.