Suppose $f$ holomorphic and its image is a subset of the unit circle. Then show f is constant. A First Course in Complex Analysis by Matthias Beck, Gerald Marchesi, Dennis Pixton, and Lucas Sabalka Exer 3.8

Suppose $f$ is holomorphic in region $G$, and $f(G) \subseteq \{ |z|=1 \}$. Prove $f$ is constant.

(I guess we may assume $f: G \to \mathbb C$ s.t. image(f)=$f(G)$. I guess it doesn't matter if we somehow have $f: A \to \mathbb C$ for any $A$ s.t. $G \subseteq A \subseteq \mathbb C$ as long as $G$ is a region and $f$ is holo there.)
I will now attempt to elaborate the following proof at a Winter 2017 course in Oregon State University.
Question 1: For the following elaboration of the proof, what errors if any are there?
Question 2: Are there more elegant ways to approach this? I have a feeling this can be answered with Ch2 only, i.e. Cauchy-Riemann or differentiation/holomorphic properties instead of having to use Möbius transformations.

OSU Pf (slightly paraphrased): Let $g(z)=\frac{1+z}{1-z}$, and define $h(z)=g(f(z)), z \in G \setminus \{z : f(z) = 1\}$. Then $h$ is holomorphic on its domain, and $h$ is imaginary valued by Exer 3.7. By a variation of Exer 2.19, $h$ is constant. QED

My (elaboration of OSU) Pf: $\because f(G) \subseteq C[0,1]$, let's consider the Möbius transformation in the preceding Exer 3.7 $g: \mathbb C \setminus \{z = 1\} \to \mathbb C$ s.t. $g(z) := \frac{1+z}{1-z}$:
If we plug in $C[0,1] \setminus \{1\}$ in $g$, then we'll get the imaginary axis by Exer 3.7. Precisely: $$g(\{e^{it}\}_{t \in \mathbb R \setminus \{0\}}) = \{is\}_{s \in \mathbb R}. \tag{1}$$ Now, define $G' := G \setminus \{z \in G | f(z) = 1 \}$ and $h: G' \to \mathbb C$ s.t. $h := g \circ f$ s.t. $h(z) = \frac{1+f(z)}{1-f(z)}$. If we plug in $G'$ in $h$, then we'll get the imaginary axis. Precisely: $$h(G') := \frac{1+f(G')}{1-f(G')} \stackrel{(1)}{=} \{is\}_{s \in \mathbb R}. \tag{2}$$
Now Exer 2.19 says that a real valued holomorphic function over a region is constant: $f(z)=u(z) \implies u_x=0=u_y \implies f'=0$ to conclude by Thm 2.17 that $f$ is constant or simply by partial integration that $u$ is constant. Actually, an imaginary valued holomorphic function over a region is constant too: $f(z)=iv(z) \implies v_x=0=v_y \implies f'=0$ again by Cauchy-Riemann Thm 2.13 to conclude by Thm 2.17 that $f$ is constant or simply by partial integration that $v$ is constant.
$(2)$ precisely says that $h$ is imaginary valued over $G'$. $\therefore,$ if $G'$ is a region (A) and if $h$ is holomorphic on $G'$ (B), then $h$ is constant on $G'$ with value I'll denote $Hi, H \in \mathbb R$:
$\forall z \in G',$
$$Hi = \frac{1+f(z)}{1-f(z)} \implies f(z) = \frac{Hi-1}{Hi+1}, \tag{3}$$
where $Hi+1 \ne 0 \forall H \in \mathbb R$.
$\therefore, f$ is constant on $G'$ (Q4) with value given in $(3)$.
QED except possibly for (C)


(A) $G'$ is a region

I guess if $G \setminus G'$ is finite, then G' is a region. I'm thinking $D[0,1]$ is a region and then $D[0,1] \setminus \{0\}$ is still a region.

(B) To show $h$ is holomorphic in $G'$:

Well $h(z)$ is differentiable $\forall z \in G'$ and $f(z) \ne 1 \forall z \in G'$ and $f'(z)$ exists in $G' \subseteq G$ because $f$ is differentiable in $G$ because $f$ is holomorphic in $G$.
$$h'(z) = g'(f(z)) f'(z) = \frac{2}{(1-w)^2}|_{w=f(z)} f'(z) = \frac{2 f'(z)}{(1-f(z))^2} $$
Now, $f'(z)$ exists on an open disc $D[z,r_z] \ \forall z \in G$ where $r_z$ denotes the radius of the open disc s.t. $f(z)$ is holomorphic at $z$. So, I guess $\frac{2 f'(z)}{(1-f(z))^2} = h'(z)$ exists on an open disc with the same radius $D[z,r_z] \ \forall z \in G'$, and $\therefore, h$ is holomorphic in $G'$.

(C) Possible flaw:

It seems that on $G'$, $f$ has value $\frac{Hi-1}{Hi+1}$ while on $G \setminus G'$, $f$ has value $1$.
$$\therefore, \forall z \in G, f(z) = \frac{Hi-1}{Hi+1} 1_{G'}(z) + 1_{G \setminus G'}(z)$$
It seems then that we've actually show only that $f$ is constant on $G$ except for the subset of G where $f=1$.
 A: The Cauchy-Riemann equations have a geometric interpretation. Let $f$
be holomorphic at $a$ and let $f'(a)\ne0$. Consider the horizontal
line through $a$ consisting of points $a+s$ for real $s$, and
also the vertical line through $a$, that is the points $a+it$ for
$t$ real.
Then these are mapped by $f$ into two curves $C_1$ and $C_2$ meeting
at $f(a)$. Cauchy-Riemann implies these meet at right angles there.
But if the image of $f$ were within a 1-dimensional subspace such as
the unit circle, then $C_1$ and $C_2$ would be restricted within
too, which means they cannot intersect orthogonally.  The only
way out of this impasse is for $f'(a)=0$. This must happen for all $a$.
An introductory book that makes much of such geometric interpretations
is Needham's Visual Complex Analysis (OUP).
If you really don't like geometry, write $f(x+iy)=u+iv$ in the usual
way. If $f$ maps to the unit circle, then $u^2+v^2=1$. Differentiating
gives $uu_x+vv_x=uu_y+vv_y=0$. Cauchy-Riemann gives
$-uv_x+vu_x=0$. Then
$$u_x=u^2u_x+v^2u_x=u(uu_x+vv_x)+v(-uv_x+vu_x)=0$$
and similarly $v_x=0$. Therefore $f'=0$.
A: Note that $f\overline {f}=1$ in $G.$ This implies $\overline {f} =1/f$ in $G.$ Hence $\overline {f}$ is holomorphic in $G.$ This implies both $f+\overline f= 2\text { Re } f$ and $f-\overline f=2i\text { Im } f$ are holomorphic in $G.$ By the remarks you made right after $(2)$ in your question, these functions are constant, which implies $f$ is constant.
A: Another fun way is to use Parseval's identity (one should never pass up an opportunity to do so). Suppose your region contains $0$ (if not, just translate it so that it does). Then $f$ has a power series representation $f(z) = \sum_{n=0}^\infty a_n z^n$ which converges near $0$, and for $r$ sufficiently small we have
$$
\frac{1}{2\pi} \int_0^{2\pi} |f(re^{i\theta})|^2 d\theta = \sum_{n=0}^\infty |a_n|^2 r^{2n}.
$$
Our assumptions imply that the left side is equal to $1$ for all such $r$, but the only way the right can be constant is if $a_n=0$ for $n \geq 1$. I guess this just shows that $f$ is locally constant, but then the derivative is $0$ at every point in $G$, and this means $G$ is globally constant.
A: In every point on a line in the plane the possible tangent vectors form a real monodimensional vector space. An holomorphic function has in every point of its domain a derivative map that is a complex linear, that is a roto-homothetic real transformation of the plane.
Turning attention to your problem: in every point of the region $G$ the tangent vectors form a bidimensional real vector space. When a tangent vector is transformed by the derivative map it is rotated and/or enlarged in the plane of the tangent vectors in the image of the point. But the only possible tangent vectors in any point of the image (subset of the unit circle, that is a set of arcs and/or points) are in a real monodimensional vector space (for points on an arc) or zero-dimensional vector space (for isolated points). So for that roto-homothetic transformation to be fitted, it must make any tangent vector in the region $G$ vanish, that is, the derivative map must be $0$.
A: After discovering the term anti-holomorphic, I have an answer similar to zhw.'s: It starts the same but then doesn't reinvent the wheel or something:

If $f: G \to \mathbb C$ is holomorphic on $G$ and anti-holomorphic on $G$, then $f$ is constant on $G$. $\tag{*}$

We have $|f|=1$ on $G$ iff $f \overline f = 1$  on $G$. Then just as in zhw.'s answer, $\overline f$ is holomorphic in $G$ i.e. $f$ is anti-holomorphic on $G$. Therefore, $f$ is constant on $G$.
Now, the non-wheel reinvention here is that the way one proves $(*)$ in the 1st place is what zhw. said. So yeah this exercise seems pretty easy if you know the concept of anti-holomorphic. It's not so advanced to teach an elementary complex analysis student, but maybe it's not something you'd teach an elementary complex analysis student.
A: i guess open mapping theorem, as suggested by Angina Seng, is inadmissible, but anyhoo
$f$ is either constant or non-constant. If constant, then done. If non-constant, then by open mapping theorem, $f$ is open. Then $G$ is open implies $f(G)$ open (in $\mathbb  C$). However no non-empty subset of the unit circle is open (in $\mathbb C$).
remarks:

*

*so it seems pretty easy with open mapping theorem, but the proof for open mapping theorem seems to use either Rouché's theorem or cauchy's differentiation formula, sooo...yeah. too high at this point of the text.


*seems kinda overkill to use open mapping. it's like using functional analysis to prove pythagorean theorem.



*

*Update: Trivia: Parseval's identity is a generalisation of pythaogrean. There's a new answer that uses Parseval's identity.

A: Here is an idea that uses a weaker version of the open mapping theorem:

*

*if $f$ is constant, then there is nothing to prove

*if $f$ is non-constant, $f'$ is not identically zero: let $z_0$ such that $f'(z_0) \neq 0$. By the inverse function theorem, there exists an open neighbourhood of $z_0$, say $V$, such that $f(V)$ is open and $f : V \to f(V)$ is bijective with smooth inverse. Hence $f(V) \subset \mathrm{Im}(f)$, and the image of $f$ contains an open subset of $\mathbb{C}$: it cannot fit in the circle, which has empty interior.

