Question: If $f$ is rational in the complex plane, and has no poles for $\Im z \ge 0$, prove that: $$\sup\{|f(z)| : \Im z \ge 0\} = \sup \{|f(z)| : \Im z = 0\}.$$
My attempt: So, I do have the solution for this problem, but I don't understand one of the conclusions, and I am hoping to get help with it. We let $f = p/q$, where $p$ and $q$ are polynomials such that none of the zeros of $q$ lie in the upper half-plane. We let $\Gamma_R$ be the curve$[-R,R] \cup C_R$, where $C_R$ is the semi-circle in the upper half plane centered at the origin of radius $R$.
Here on of the parts I don't understand: it's clear that by the maximum modulus principle, for any $R$ the maximum of $f$ in $\Gamma_R$ is on the boundary. Therefore, $$\sup\{|f(z)| : \Im z \ge 0\} = \lim_{R\to\infty} \sup\{|f(z)| : z \in \Gamma_R\}.$$ But here, the solution says: let's call this value $M$, but I don't understand why this value approaches a limit, and why it can't just go to infinity. I mean, if $\deg q > \deg p$, then the limit is $0$, so the result is obvious. But if $\deg q < \deg p$, why does this limit even exist??
Also, if $\deg q = \deg p$, then the limit is a constant, say $M$. But still, why does this mean that the maximum is specifically on $\{z : \Im z = 0\}$? Why can't it be on the semi-circle?
I know I'm just being stupid and missing something obvious, but I can't figure it out, and would appreciate any help. Thanks!
Let's define $M_R := \sup \{ \lvert f(z)\rvert : z \in \Gamma_R\}$. The maximum modulus theorem tells us that $M_R$ is increasing (possibly nonstrictly) in $R$. Therefore
$$M = \lim_{R \to +\infty} M_R$$
exists in $[0,+\infty]$.
As a map $\widehat{\mathbb{C}} \to \widehat{\mathbb{C}}$ ($\widehat{\mathbb{C}}$ is the Riemann sphere), $f$ is continuous. We have $M = +\infty$ if and only if $f$ has a pole at $\infty$, equivalently if and only if $\deg p > \deg q$. Then we also have $f(\pm R) \to \infty$, so $\sup \{\lvert f(z)\rvert : z \in \mathbb{R}\} = +\infty = M$. And if $M < +\infty$, then $f$ has a finite value at $\infty$, and we have
$$\lim_{R \to +\infty} \sup \{ \lvert f(z) - f(\infty)\rvert : z \in C_R\} = 0.$$
In particular, we have $\lvert f(\pm R) - f(\infty)\rvert \to 0$, so
$$M \geqslant \sup \{ \lvert f(z)\rvert : z \in \mathbb{R}\} \geqslant \lvert f(\infty)\rvert = \lim_{R \to +\infty} \sup \{ \lvert f(z)\rvert : z \in C_R\}.$$