$G\subset \mathbf{C} , G= \{z\in \mathbf{C}| \overline{z}\in G\} = \overline{G}$, then for $f\in \mathcal{O}(G)$ it holds that:$f(G\cap \mathbf{R}) \subset \mathbf{R} \Leftrightarrow \forall z\in G : f(\overline{z}) = \overline{f(z)}$
This is an example in the script of our professor, however there is no proof for it and it hasn't been shown during the lectures either.
Proof : "\Rightarrow " : Let $f(G\cap \mathbf{R}) \subset \mathbf{R}$, so all points on the real axis are mapped to the real axis. That means $f$ does not have any imaginary part, because then this would not be true anymore. Since f does not have any imaginary part. it follows also that : $f(\overline{z}) = \overline{f(z)}$
"\Leftarrow" : Let $f(\overline{z}) = \overline{f(z)}$, so f can not have any imaginary part, otherwise this would not be true anymore. But if f doesn't have any imaginary part, then the map of the real axis is always on the real axis. So $f(G\cap \mathbf{R}) \subset \mathbf{R}$
What I mean with not having any imaginary part is that it is of the form $f(z) = z ; f(z)=2z; f(z) = 2z+z^{3}$ etc.
I am not sure if this is the right thought, and how to express this better.
Help is greatly appreciated.