Hint: A non-constant analytic function $f$ is an open mapping, i.e., if $U\subseteq \mathbb{C}$ is an open subset, then the image $f(U)$ is also an open subset of the complex plane.
Complete Solution (using the hint above; please avoid hovering your mouse cursor over the (silver) box below if you do not wish to view the solution):
Since no subset of the real line can be an open subset of the complex plane (except, of course, for the empty subset), $f$ must in fact be constant and the image of the imaginary axis (in particular) under $f$ is a single point. Therefore, $B$ is the correct choice.
Alternate Hint: The maximum modulus principle.
The following exercises are relevant to your question:
Exercise 1: If no non-empty subset of $A$ is open in the complex plane, prove that there is no non-constant entire function $f$ that maps the complex plane into $A$. Can you prove this result using only the Cauchy-Riemann equations?
Exercise 2: If $U$ is an open subset of the complex plane, does there exist a non-constant analytic function $f$ that maps the complex plane into $U$? Does the answer change if you restrict to the unbounded open subsets $U$ of the complex plane?
Exercise 3: Prove that there exists an analytic function $f$ that maps the imaginary axis in the complex plane bijectively onto the real axis.
Exercise 4: Find an invertible holomorphic mapping of the open unit disc (${z:\left|z\right|<1}$) onto the upper half plane ({z:\text{Im}(z)>0}). Hence solve the Dirichlet problem in the upper half plane using the Poisson kernel on the open unit disk.
Challenging Exercise/Important Result (The Riemann Mapping Theorem): If $U$ and $V$ are proper, simply connected (and non-empty), open subsets of the complex plane, prove that there is an invertible holomorphic mapping of $U$ onto $V$. (If you cannot prove this, then you can look up the proof in most texts on complex analysis or online. However, the result is important and therefore you should at least understand the statement.)
Easy Exercise (based on the Riemann Mapping Theorem): Why is the assumption that both open sets be "proper" necessary in the Riemann mapping theorem? More precisely, why does not there exist an invertible holomorphic map from the complex plane onto the unit disk?