Suppose an entire function $f$ is real if and only if $z$ is real. Prove that $f$ has at most $1$ zero.
Solution 1:
The argument principle is useful to solve this problem. There are two ways you can think about the argument principle. One way is you use an integral formula over a closed curve and a number pops out, representing $2\pi i$ times the number of zeros minus the number of poles. The other way is to think about how given a curve $\gamma$, not necessarily closed, the integral $\int_{\gamma}{\frac{f'(z)}{f(z)}dz}$ represents the increase in argument of $f$ along $\gamma$, i.e. how much the image of the path $\gamma$ winds around the origin. And this last number need not be an integer multiple of $2\pi i$.
Of course, these two ways of thinking are really the same, but if you are having trouble evaluating an integral, or you prefer to use a more geometric argument, it can be helpful to think about it the second way. In Gamelin's Complex Analysis p227, there is a nice example illustrating this technique:
We want to find the number of zeros of the polynomial $p(z) = z^6 + 9z^4 + z^3 + 2z + 4$ in the first quadrant. So what we do is to take a curve $\gamma$ that starts at $0$ and goes out to $R$ along the real axis, then moves counter-clockwise along the arc ${|z|=R}$ a quarter of a circle until $iR$, and then moves down the imaginary axis back to $0$. If we determine the increase in argument of $f$ along each of the three pieces of the curve, it will tell us how many zeros there are in that quarter slice. Along the real axis, $p(z) > 0$, so the argument of $f\circ\gamma$ is constant. If we have chosen $R$ large enough, the $z^6$ term will dominate the polynomial around the quarter-circle, so the increase in argument of $f\circ\gamma$ will be approximately $6$ times that of $\gamma$: $6(\frac{\pi}{2}) = 3\pi$. Then we can examine $f\circ\gamma$ for the last segment of our curve and find it contributes an additional $\pi$ to the argument. So we have a total increase of about $4\pi$ in the argument of $f$ along $\gamma$, which means there are $2$ zeros in the first quadrant.
So now to apply this idea to your problem. Let $\gamma$ be a circle of radius $R$ around $0$. The integral $\frac{1}{2\pi i}\int_{\gamma}{\frac{f'(z)}{f(z)}dz}$ will equal the number of zeros contained inside the curve, which will equal the number of zeros of $f$ on the real interval $[-R,R]$, since our hypothesis tells us the zeros can only occur on the real axis. How much can the argument of $f$ increase along $\gamma$? First consider the increase around the upper half of the circle. $\gamma(t) \in \mathbb{R}$ exactly when $t$ equals $0$ or $\pi$, so by our hypothesis, these are the only times $f\circ\gamma$ can cross the real axis. So from $t$ equals $0$ to $\pi$, the argument can only increase by exactly $\pi$ or $-\pi$. Then the same argument applies to the bottom half of the circle $\gamma$. So as $\gamma$ goes counter-clockwise around the origin, $f\circ\gamma$ will have an increase in argument of $2\pi$, $0$, or $-2\pi$. But the last possibility is excluded because our function has no poles.
Solution 2:
Here's a rough sketch. First prove that $f$ cannot have a repeated zero by analyzing the behaviour of $f$ near a zero. Then note that $f+r$ has the same property for any $r \in \mathbb{R}$, so prove that $f$ cannot have two real zeros by using this together with the first part.