Proving that a holomorphic function is constant I am trying to solve the following problem: "Assume that $f$ is holomorphic in $\mathbb{D}$ and continious on $\bar{\mathbb{D}}$. If $f(z) = f(1/z)$, for all $|z| = 1$, prove that $f$ is constant." (Rice University, May 2022, Analysis Qual Exam Question)
My attempt: I define a new function $G : \mathbb{C} \rightarrow{} \mathbb{C}$ as follows:
\begin{equation}
G(z)=
    \begin{cases}
        f(z) & \text{if } |z| \le 1 \\
        f(1/z) & \text{if } |z| > 1 
    \end{cases}
\end{equation}
Now, we claim that $G$ is entire.(I am not sure this is true, but I believe that $f(z) = f(1/z)$ for $|z|=1$, makes it true). Then, since $f$ is a continious function on the closed unit disc, $f$ is bounded in $\bar{\mathbb{D}}$. As a result, $G$ is a bounded entire function. Thus, we are done with Liouville's Theorem.
Is my approach correct? Is $G$ really entire? If yes, how can I show it rigorously? If not, what should be the correct approach to attack this problem?
Thanks, in advance.
 A: Your approach is correct. To prove $G$ is entire you can use the Schwarz reflection principle. That Wikipedia article states the result for reflection over $\mathbb{R}$ but in fact you can reflect across any circle (lines count as circles) by composing with a Mobius transformation that maps your circle to the real line.
In this case you could use $T(z) = -i \frac{z-1}{z+1}$ to map $\mathbb{D} \to $ the upper half-plane. Then you could define $h(z) = T(G(T^{-1}(z)))$ which maps UHP to UHP and will satisfy the preconditions for Schwarz reflection. Once you know $h$ is entire, it's clear that $G$ is too.

A comment from @peek-a-boo suggested you could prove $G$ is holomorphic using Morera's theorem. That's true, but you'll basically just end up repeating the proof of Schwarz reflection (which is in fact normally done using Morera). I'm guessing you've learned Schwarz reflection, and if so then I think you should just use Schwarz reflection instead. (The comment is still useful though; it never hurts to remember why our fancy theorems are true!)
A: A direct solution using harmonic functions can be done like this; note that both $f, \bar f(z)=f(\bar z)$ are harmonic on the open unit disc and continuous on the boundary, while $f -\bar f=0$ on the unit circle since $1/z=\bar z$ there. Hence $f-\bar f=0$ inside the unit disc (eg by continuity $f-\bar f$ is the Poisson integral of its boundary function or by maximum/minimum modulus principle for real harmonic functions applied to the real and imaginary parts of $f-\bar f$).
But this means that $f$ is both holomorphic and anti-holomorphic inside the unit disc so is constant
