I could prove that if $g(z)$ is bounded and analytic except at a finite number of points in the complex plane $\mathbb{C}$, $g(z)$ must be constant.
First I thought I can use the above to prove the following theorem, but I couldn't and I would like to know if I have made any mistake in my solution.
let $f(z)$ be analystic except at a finite number of poles and suppose that, for some positive numbers $M, \:R$ and a positive integer $n$, $$|f(z)|\leq M|z|^n\:\:\:\text{whenever}\:\:|z|>R$$ Show that $f(z)$ must be a rational function.
Define $g(z):=\frac{f(z)}{z^n}$. The function $g(z)$ has the finite number of poles or singularities, so if I can show $g(z)$ is bounded, using above theorem, we get $g(z)$ is a constant and so $f(z)= g(z) z^n$. I think it's wrong, since there are rational functions other than $z^n$ that can statisfy in the question assumptions, so $g(z)$ might not be bounded on $\overline{D(0,R)}$.
Now I define $h(z)=\Pi_{j=1}^m(z-p_j).f(z)$, where $p_j$ are poles of $f(z)$ considering the multiplicity (note that $h(p_j)\neq 0$ for each $j\in\{1,\dots,m\}$).
The function $h(z)$ is analytic, so over $\overline{D(0,R)}$, it attains its maximum, also all derivatives of $h(z)$ are analytic and attain their maximum over $D(0,R).$
For $|z|>R$, we get $$|h(z)|\leq M|z|^n.\Pi_{j=1}^m(z-p_j),$$
If we differentiate it $m+n$ times, the $(m+n)$ derivative becomes bounded by a constant, as $h^{(n+m)}(z)$ is analytic and bounded so it is constant, which show that $h(z)$ is a polynomial of degree at most $n+m$. so eventually $f(z)=\frac{h(z)}{\Pi_{j=1}^m(z-p_j)}$, as desired.
The last paragraph seems wrong and non convincing though!
The inequality $|P(z)|\leq K |z|^{\deg(P)}$ for $|z|$ sufficiently large and $K$ some large enough constant holds for any polynomial $P$. Apply this to the right-hand side of your inequality for $|h(z)|$ to get a similar inequality for it. Now your earlier argument works.