After viewing this question, I was struggling to show that $f(z)$ tends to infinity as $z$ goes to infinity, in other words, showing that infinity cannot be an essential singularity of $f$ (without using Great Picard Theorem or Poisson Integral), what I know at the moment is only that $f$ goes to infinity as $z$ is real and goes to infinity. After showing this the idea was that infinity cannot be a removable singularity by using Liouville's Theorem, which leaves us with the case of infinity being a pole, thus $f$ is a polynomial with one zero, which makes it linear as required.
Thanks
One way to prove that $f$ cannot have an essential singularity is to prove that $f$ is a rational function. To do so, let us take the Cayley transform, $C(z)=\frac{z-i}{z+i}$ (recall that $C:\mathbb{H}\to \mathbb{D}$ is a biholomorphic rational map). Considering $g:=C\circ f\circ C^{-1}$, we see that $g:\mathbb{D}\to \mathbb{D}$ is a holomorphic map such that $\lim_{|z|\to 1}|g|=1$. It is a standard exercise to prove that this implies that $g$ is a rational function. Given that $C$ is a rational function (and so is $C^{-1}$), we get that $f$ must be a rational function and we are done.