The Schwarz Reflection Principle for a circle
Solution 1:
First note that the hypothesis implies that $f$ has only a finite number of zeros in the unit disk $\mathbb{D}$, say $\alpha_1, \dots, \alpha_n$. Consider now the function $$B(z):=\prod_{j=1}^n \frac{z-\alpha_j}{1-\overline{\alpha_j}z}.$$ This is a finite Blaschke product and $|B(z)| =1$ for all $z \in \partial \mathbb{D}$. Since $B$ has the same zeros as $f$, it follows that both $f/B$ and $B/f$ are analytic in $\mathbb{D}$ and continuous on $\overline{\mathbb{D}}$. By the maximum principle applied to both quotients, we deduce that $|f/B|=1$ everywhere in $\mathbb{D}$, so that $f/B$ is a unimodular constant $\lambda$, by the open mapping theorem. Therefore $f= \lambda B$, a rational function.
Solution 2:
In the given situation, we can proceed directly. The reflection in the unit circle is given by
$$\rho(z) = \overline{z}^{-1},$$
so by setting
$$g(z) = \frac{1}{\overline{f(\overline{z}^{-1})}},$$
we obtain a function $g$ that is meromorphic in the outside of the unit disk. Since $f$ can have only finitely many zeros in $\mathbb{D}$, $g$ has only finitely man poles in $\hat{\mathbb{C}} \setminus \overline{\mathbb{D}}$,
and since $\lvert f(z)\rvert = 1$ for $\lvert z\rvert = 1$, the function
$$h(z) = \begin{cases}f(z) &, \lvert z\rvert \leqslant 1\\ g(z) &, \lvert z\rvert > 1\end{cases}$$
is continuous (outside the poles, none of which lies on $\partial \mathbb{D}$), and holomorphic outside $\partial \mathbb{D} \cup \{\text{poles}\}$. By a small modification of Morera's theorem (you can map each arc on the circle to the real axis by a Möbius transformation), it is meromorphic on all of $\hat{\mathbb{C}}$, hence rational.
You can also use the Cayley transform as you started with, if $f$ is not constant, then $f$ can take the value $1$ only finitely often on $\partial\mathbb{D}$, and $g = T^{-1}\circ f \circ T$ has only finitely many poles on $\mathbb{R}$, and either a pole or a removable singularity in $\infty$, on each interval between two poles, you can apply the ultra-classic reflection principle to see that $g$ can be extended by reflection to a meromorphic function on $\hat{\mathbb{C}} \setminus \{\text{poles}\}$, hence is rational.