I was asking myself whether or not the following statement is true, and I think it is.
The conjecture
Let $f$ be an entire function, i.e. $f$ holomorphic and $f:\mathbb C\to \mathbb C$. We assume that
$$f(\mathbb C)\cap \mathbb R=\emptyset.$$
Then $f$ is constant.
What I tried
This statement came to me because of the Cauchy-Riemann equations.
If $f$ is an holomorphic function ($f:\mathbb R^2\simeq \mathbb C\to \mathbb C$), $P(x,y)=\mathfrak R(f)$ and $Q=\mathfrak I(f)$ then
$$\begin{cases} \displaystyle\frac{\partial P}{\partial x}=\frac{\partial Q}{\partial y} \\ \displaystyle\frac{\partial P}{\partial y}=-\frac{\partial Q}{\partial x}. \end{cases}$$
With those equations, we can say that if $f(\mathbb C)\subset \mathbb R$, then $f$ is constant (we then have both partial derivates of $Q$ which are null).
May be we could find a solution here, because if $f(\mathbb C)\cap \mathbb R=\emptyset$, then $Q$ doesn't change sign. But we lack a lot of informations to conclude...
May be we can use Liouville theorem to prove a partial result: if
$$\vert f(x)\vert \xrightarrow[\vert z \vert \to \infty]{} +\infty$$
then $f$ is constant.
But again, this is not really satisfying.
The comment by basket shows a way towards a proof.
An entire function that avoids all reals, cannot have dense image, as its image must lie in one hyperplane. Yet an entire function that does not have a dense image is easily seen to be constant.
For let $w_0$ be at a positive distance from the image of $f$. Then $z \mapsto (f(z)-w_0)^{-1}$ is entire and bounded, whence constant.