Meromorphic function with constant magnitude on closed unit disk

I was reading the solution of a problem in the book "Berkeley problems in mathematics", and last part of the proof is unclear to me.

It somehow proves using Maximum principle that the rational function with given properties has constant magnitude on closed unit disk. Then, it immediately concludes that the function must be constant everywhere. I really don't get this. I'm asking this way in case there is a general fact about meromorphic functions, and this is just a special case. If that's not the case, I can give more details about what things the problem is specifically dealing with. I would appreciate any help. Thanks!

The maximum principle states that a non-constant holomorphic function $f: U \to \mathbb{C}$ on a simply connected open set $U \subseteq \mathbb{C}$ does not attain a maximum on $U$, i.e. there is no $x_0 \in U$ such that $\vert f(x_0) \vert \geq \vert f(x) \vert \, \forall x \in U$. If on the other hand a function does attain a maximum (if for example $\vert f \vert$ is constant), then $f$ must be constant.
The fact that your $f$ is holomorphic, that is that it has no poles also follows from $\vert f \vert$ being constant, thus bounded.
• Well, if $f$ is constant on the open disk, then by the identity theorem it must be constant everywhere. – Zardo Jun 29 '15 at 19:53
• That is not true. The identity theorem uses power series representation and works for all analytic functions which include functions which are meromorphic on $\mathbb{C}$. – Zardo Jun 29 '15 at 19:58