TITLE: Let $P$ be a complex polynomial such that $z \in \mathbb{R} \iff P(z) \in \mathbb{R}$. Show that $deg P = 1$
QUESTION [5 upvotes]: I need some help with the following question:
Let $P$ be a complex polynomial such that $z \in \mathbb{R} \iff P(z) \in \mathbb{R}$. Show that $deg P = 1$
There's also a hint:
Define $P = u+iv$ and show that either $v_y \le 0$ or $v_y \ge 0$ on the real axis.
I've managed to prove that. Then using CR equations I deduced that $u$ is monotone on the real axis which proves that $deg P$ is odd. I'm not sure what to do next.
Any help will be greatly appreciated
Thank you

REPLY [3 votes]: As you and lhf both noted, $P(z)$ has real coefficients; from the hypothesis the $v$ vanishes exactly on the real axis, we know that (possibly after replacing $P$ with $-P$) $v$ is strictly positive (say) on the upper half plane and strictly negative on the lower half plane. Therefore $v_y\ge0$ on the real axis. By $CR$, we know that $u_x \ge 0$ on the real axis, as you said. Hence, viewing $P$ as a polynomial function from the reals to the reals, we know that $P$ is nowhere decreasing.  $P$ is not constant (otherwise the entire complex plane is mapped into the reals, contrary to hypothesis), so there is a $a\in {\mathbb R}$ such that $P'(a)$ is not zero. Let 
$c = P(a).$
Then, the polynomial $P(z) - c $ does not have a repeated root at $a$.
Hence, if $P$ is not of degree one, there is a  $b  \not=a$ (which must also be real, by the premise of the question) such that 
$$c = P(b) = P(a).$$      
But this is not possible  (as $P$ is nowhere decreasing, and $P'(a)\not= 0.$)
Hence $P$ is of degree one.