Here is another way to phrase Igor Rivin's and Sourav D's answers, which might make them seem more elementary and "discoverable''.
The basic facts one should know are:
a non-zero entire function has only finitely many zeroes contained in the unit disk (since the zeroes are a discrete subset of $\mathbb C$);
if $|a| < 1$, then $(z-a)/(1 - \overline{a} z)$ is a holomorphic function on the unit disk, taking the unit circle to itself, and with a zero at $a$.
Combining these, we find that for our given function $f$ as in the question,
there is a polynomial $g$ with the same zeroes as $f$ (and with the same multiplicities), which also satisfies $|g| = 1$ when $|z| = 1$.
The ratio $f/g$ then has no zeroes on the unit disk, and still takes the unit circle to itself. As Igor Rivin indicates in his comment, an argument with logs
and maximum modulus shows that this ratio is constant, and thus that $f$ is a constant (of modulus $1$) times $g$. (Or, as Sourav D notes, you can apply max. and min. modulus directly to $f/g$.)
Finally, the fact that $f$ is entire puts pretty severe constraints on the values of $a$ that can appear in $g$!
So basically, in order to apply the hint, you have to construct the candidate polynomial, and you do this
by a consideration of the zeroes of $f$ in the unit disk.