Find all polynomials $p(x) \in \mathbb{C}[x]$ such that $p(\mathbb{R}) \subset \mathbb R $ and $p(\mathbb{C - R}) \subset \mathbb{C - R }$. Find all polynomials $p(x) \in \mathbb{C}[x]$ such that $p(\mathbb{R}) \subset \mathbb R $ and $p(\mathbb{C - R}) \subset \mathbb{C - R }$.
Note that  $ \mathbb C =\{a+bi\mid a,b \in\mathbb R \}$.
For example let $0 \neq a_0,c_0 \in\mathbb R $ then $p(x)=a_0x +c_0$ is one answer.
 A: You're on exactly the right track.
First, let us note that $p$ and $\overline{p}$ agree on $\mathbb{R}$, since $p(x) = \overline{p(x)} = \overline{p}({\overline{x}}) = \overline{p}(x)$ for all $x \in \mathbb{R}$. Since they agree on infinitely many values, we have $p = \overline{p}$; thus, $p$ has coefficients in $\mathbb{R}$. That is, $p \in \mathbb{R}[x]$.
Let us evaluate $p$ a bit further. Clearly, we cannot have that $p$ is a constant polynomial, since then we would have, for example, $p(i) = p(0) \in \mathbb{R}$, which is forbidden.
So $\deg(p) > 0$. We now consider two cases.
First, suppose the degree of $p$ is even. In this case, $\inf\limits_{x \in \mathbb{R}} p(x)$ exists. Let $w = \inf\limits_{x \in \mathbb{R}} p(x)$. Consider $q(x) = p(x) - w - 1$. Now $\deg(q) = \deg(p) > 0$. By the fundamental theorem of algebra, $q$ has a root; call it $r$. Clearly, $r \notin \mathbb{R}$. Then $p(r) \in \mathbb{R}$, but $r \notin \mathbb{R}$. This goes against the requirement that $p(\mathbb{C} \setminus \mathbb{R}) \subseteq \mathbb{C} \setminus \mathbb{R}$.
Now suppose the degree of $p$ is odd. We can show that for sufficiently large $w$, there is exactly one $r \in \mathbb{R}$ such that $p(r) = w$, and also that $w$ is not a multiple root. This is because for sufficiently large or small $x$, $p’(x) > 0$. Therefore, we know that $p$ must be of degree 1, since otherwise, there would be a second, necessarily non-real solution to $p(r) = w$, which is impossible.
So we know that $p$ is a degree-one polynomial in $\mathbb{R}(x)$. In other words, the solutions you laid out in your question are the only ones.
A: Here is a geometrically minded proof using some topological analysis (e.g. from Beardon's Complex Analysis).  We can assume $p$ has degree $d \gt 0$ since a constant polynomial has a single point in its image that cannot be both real and non-real thus $p$ is non-constant.
(i) The requirement $p(\mathbb{C - R}) \subset \mathbb{C - R }$ implies each half plane of $p(\mathbb{C - R})$ is mapped to a half plane (since connectedness is preserved under continuous maps).
Geometrically what this means: is if we consider a counter-clockwise simple closed curve whose image is a circle (with large enough radius) starting at 1, then computing the winding number around zero under the image of $p$ will count the number of roots and hence gives us $d$; but (i) tells us if we split said curve under the image of $p$ into halves, the first half begins and ends on the real line and is always contained in a single closed half plane, hence the angle swept by the curve must equal $\pm 180$ degrees or $0$ degrees; the same applies for the second half of the curve; conclusion: the original closed curve must wind around the origin 0 or 1 times. Since $d\gt 0$ this tells us $d=1$.

Consider the closed curve
$\gamma: [0,1]\longrightarrow \mathbb C$ given by
$\gamma(t)=r\cdot \exp(2 \pi \cdot i \cdot t)$
for large enough $r$ (i.e. so $r$ is larger than the modulus of all of the $d$ roots of $p$)
(with $p(z) = \sum_{k=0}^d a_k z^k$, e.g. in the case of monic $p$, then $r\geq 2+ \sum_{k=0}^d \vert a_k\vert$ works).
and now split the closed curve $\gamma$ into two halves, $\gamma_1:[0,\frac{1}{2}]\longrightarrow \mathbb C$ and $\gamma_2:[\frac{1}{2},1]\longrightarrow \mathbb C$
$\gamma_1(t) =r\cdot \exp(2 \pi \cdot i \cdot t)$ i.e. is $= \gamma_{\big\vert[0,\frac{1}{2}]}$, i.e. $\gamma$ restricted to the first half of the closed interval,  and
$\gamma_2(t) =r\cdot \exp(2\pi \cdot i \cdot t)$ i.e. $= \gamma_{\big\vert[\frac{1}{2},1]}$
Then computing the winding number of $p\circ \gamma$ which counts the roots and hence the degree
$d = n\big(p\circ \gamma, 0\big) = n\big(p\circ \gamma_1, 0\big) +n\big(p\circ \gamma_2, 0\big) \leq \vert n\big(p\circ \gamma_1, 0\big)\vert  +\vert n\big(p\circ \gamma_2, 0\big)\vert\lt 2 $
since $\vert n\big(p\circ \gamma_1, 0\big)\vert \lt 1$  and  $ \vert n\big(p\circ \gamma_2, 0\big)\vert \lt 1$
that is, $p\circ \gamma_1$ is non-zero (since $r$ is large enough) and stays in the same closed half-plane hence it never intersects one of the purely imaginary half lines i.e. never intersects the ray (with $t\geq 0$) given by
(a) $t\cdot \exp\big(i\cdot\frac{\pi}{2}\big)$ or (b) $t\cdot \exp\big(i\cdot\frac{3\pi}{2}\big)$.  Hence the winding number has modulus strictly $\lt 1$.  (This is property I5 in chapter 7, section 3 of Beardon for those interested). And the same bounding argument holds for $p\circ \gamma_2$.  Conclude: $0\lt d\lt 2\implies d= 1$.
