Automorphism of $\mathbb{C}\setminus \{0,1\}$.
You already know that $0$ and $1$ are not essential singularities. In the same way (or by considering $1/f$) one can see that $\infty$ is not an essential singularity either.
So $f$ is holomorphic in $\mathbb{C}\setminus \{0,1\}$ with removable singularities or poles at $0, 1, \infty$. It follows that $f$ is a rational function. Since the restriction of that rational function to $\mathbb{C}\setminus \{0,1\}$ is injective, the degree must be equal to one.
So $f$ is a rational function of degree one (aka “Möbius transformation”), which maps $\{ 0, 1, \infty \}$ onto itself. There are exactly six such functions, one for each permutation of $(0, 1, \infty)$.
$z, 1-z, 1/z, 1/(1-z), z/(z-1), (z-1)/z$