Let $f:\mathbb{C}\to\mathbb{C}$ be an entire function be such that $\mathbb{R}=f^{-1}(\mathbb{R})$. Show that $f$ is linear. i.e.
$$\exists\ a,b\in\mathbb{R}:f(z)=az+b$$
Hint
I think that $f$ must map the upper half plane and lower half plane to certain two disconnected open sets.
Maybe, if we can show that $f$ is a mobius transformation, then we can then we can look at
$$g(z)=\frac{f(z)-f(0)}{z}$$
and finish.