Let be $ f : \mathbb{C} \rightarrow \mathbb{C} $ a entire function. If it verifies that $ f(\mathbb{C}) \cap \mathbb{R} = \emptyset $ then we cand deduce that $ f $ is constant* (see below to proof), but my question is, the same statement is true if $ f( \mathbb{C} ) \cap [0, \infty) = \emptyset $? And generally, if $ f(\mathbb{C}) \cap [a,b] = \emptyset $ then $ f $ must be constant?
I have test some entire functions for the case $ [0, \infty) $ like $ \sin(z) $ and $ \cos(z) $ but I haven't found a conterexpample. I haven't found any similar way to proced like in the case $ f(\mathbb{C}) \cap \mathbb{R} $.
*Proof:
From $ f( \mathbb{C}) \cap \mathbb{R} = \emptyset $ we deduce that $ \Im(f(z)) > 0 \ \forall z \in \mathbb{C} \ $ or $ \ \Im(f(z)) < 0 \ \forall z \in \mathbb{C} $, because $ f $ is continuous and then $ f( \mathbb{C} ) $ must be a connected subset of $ \mathbb{C} $.
Now we consider the compositions $ e^{if} = e^{-v + iu} $ and $ e^{-if} = e^{v - iu} $ where $ f = u + iv $. This functions must be also entire, and we have $$ | e^{if} |= |e^{-v + iu}| = e^{-v} \ \ \mbox{ and } \ \ | e^{-if} |= |e^{v - iu}| = e^{v} $$ So, if $ v(z) = \Im(f(z)) > 0 \ \forall z \in \mathbb{C} $, the first equality gives that $ |e^{if(z)}| \leq 1 $. In the same way, if $ v(z) = \Im(f(z)) < 0 $, the second equality gives that $ |e^{-if(z)}| \leq 1 $.
As $ e^{if} $ and $ e^{-if} $ are entire bounded functions, they must be constant. So we deduce $ f $ is a constant function.
If $f(z) \notin [0,+\infty)$ for every $z\in \mathbb{C}$, consider the function defined by $g(z) = \sqrt{f(z)}$, where you use your favourite branch of the square root on $\mathbb{C}\setminus [0,+\infty)$. Then $g$ has image in either the upper or the lower half-plane, hence is constant by what you already know. But then $f(z) = g(z)^2$ is constant too.
If $f(\mathbb{C}) \subseteq \mathbb{C}\setminus [a,b]$, where $a \neq b$ and $[a,b]$ denotes the segment between the two points, consider the function defined by
$$h(z) = \frac{f(z)-a}{b-f(z)}\,.$$
Then $h$ is an entire function with $h(\mathbb{C}) \subseteq \mathbb{C} \setminus [0,+\infty)$. So $h$ is constant by the previous, and $f$ is constant because
$$f(z) = \frac{bh(z)+a}{h(z)+1}.$$