[proofplan]
We use compactness to choose a point where the [continuous function](/page/Continuous%20Function) $|f|$ attains its maximum. Around any point where $f$ has the same value as this maximum point, a holomorphic coordinate chart turns $f$ into a [holomorphic function](/page/Holomorphic%20Function) on an open subset of $\mathbb{C}^n$ whose modulus has a local maximum. The [maximum modulus principle](/theorems/491) then gives local constancy near that point. Thus the level set of the maximum value is both closed and open, and connectedness forces it to be all of $X$.
[/proofplan]
[step:Choose a point where $|f|$ attains its maximum]
Because $f:X\to\mathbb{C}$ is holomorphic, it is continuous. Define the continuous function $u:X\to\mathbb{R}$ by $u(q)=|f(q)|$ for every $q\in X$.
Since $X$ is nonempty, compact, and $u$ is continuous, the extreme value theorem gives a point $p\in X$ such that
\begin{align*}
u(q)\leq u(p)
\end{align*}
for every $q\in X$. Define
\begin{align*}
M:=u(p)=|f(p)|.
\end{align*}
If $M=0$, then $|f(q)|=0$ for every $q\in X$, hence $f(q)=0$ for every $q\in X$, and the theorem follows. Hence we may assume $M>0$.
[guided]
The compactness hypothesis is used exactly here. Since $f$ is holomorphic, it is continuous as a complex-valued function on the underlying [topological space](/page/Topological%20Space) of $X$. Therefore the modulus function $u:X\to\mathbb{R}$ defined by $u(q)=|f(q)|$ for every $q\in X$ is continuous. Since $X$ is nonempty and compact, a continuous real-valued function on $X$ attains its maximum, so there is a point $p\in X$ such that
\begin{align*}
|f(q)|\leq |f(p)|
\end{align*}
for every $q\in X$.
We denote this maximum value by
\begin{align*}
M:=|f(p)|.
\end{align*}
If $M=0$, then $|f(q)|\leq 0$ for every $q\in X$. Since absolute values are nonnegative, this gives $|f(q)|=0$, hence $f(q)=0$, for every $q\in X$. Thus the only remaining case is $M>0$.
[/guided]
[/step]
[step:Define the level set of the maximum value and prove it is closed]
Define the subset
\begin{align*}
A:=f^{-1}(\{f(p)\})=\{q\in X:f(q)=f(p)\}.
\end{align*}
The singleton $\{f(p)\}\subset\mathbb{C}$ is closed, and $f:X\to\mathbb{C}$ is continuous. Therefore $A$ is closed in $X$. Also $p\in A$, so $A$ is nonempty.
[/step]
[step:Use the maximum modulus principle to prove the level set is open]
Let $q\in A$. Then $f(q)=f(p)$, so
\begin{align*}
|f(q)|=|f(p)|=M.
\end{align*}
Let $(U,\varphi)$ be a holomorphic coordinate chart of $X$ around $q$, where
\begin{align*}
\varphi:U\to \varphi(U)\subset\mathbb{C}^n
\end{align*}
is a homeomorphism onto an open subset of $\mathbb{C}^n$. Shrink $U$ if necessary to a chart neighbourhood whose coordinate image $\varphi(U)$ is connected; for example, choose an open Euclidean ball
\begin{align*}
B(\varphi(q),r)\subset \varphi(U)
\end{align*}
with $r>0$, and replace $U$ by $\varphi^{-1}(B(\varphi(q),r))$.
Define the coordinate representative $g:\varphi(U)\to\mathbb{C}$ by $g(z)=f(\varphi^{-1}(z))$ for every $z\in\varphi(U)$.
Since $f$ is holomorphic on the [complex manifold](/page/Complex%20Manifold) $X$ and $(U,\varphi)$ is a holomorphic chart, $g$ is holomorphic on the connected [open set](/page/Open%20Set) $\varphi(U)\subset\mathbb{C}^n$. For every $z\in\varphi(U)$,
\begin{align*}
|g(z)|=|f(\varphi^{-1}(z))|\leq M=|f(q)|=|g(\varphi(q))|.
\end{align*}
Thus $|g|$ attains a maximum at the interior point $\varphi(q)$ of the domain $\varphi(U)$. By the Maximum Modulus Principle for holomorphic functions on connected domains in $\mathbb{C}^n$, $g$ is constant on $\varphi(U)$. Since $g(\varphi(q))=f(q)=f(p)$, it follows that $f=f(p)$ on $U$. Hence $U\subset A$, so every point of $A$ has an open neighbourhood contained in $A$. Therefore $A$ is open in $X$.
[guided]
We now prove openness of $A$. Fix a point $q\in A$. By definition of $A$, this means
\begin{align*}
f(q)=f(p).
\end{align*}
Taking absolute values gives
\begin{align*}
|f(q)|=|f(p)|=M.
\end{align*}
Because $M$ is the global maximum of $|f|$ on $X$, the point $q$ is also a point where $|f|$ attains its global maximum.
To use the maximum modulus principle, we pass to local holomorphic coordinates. Choose a holomorphic coordinate chart $(U,\varphi)$ around $q$, with
\begin{align*}
\varphi:U\to \varphi(U)\subset\mathbb{C}^n
\end{align*}
a homeomorphism onto an open subset of $\mathbb{C}^n$. The maximum modulus principle is stated for connected domains, so we ensure connectedness by shrinking the chart domain. Since $\varphi(U)$ is open and contains $\varphi(q)$, there exists $r>0$ such that
\begin{align*}
B(\varphi(q),r)\subset \varphi(U).
\end{align*}
Replacing $U$ by $\varphi^{-1}(B(\varphi(q),r))$, we may assume $\varphi(U)$ is a connected open ball in $\mathbb{C}^n$.
Define the coordinate representative of $f$ to be the map $g:\varphi(U)\to\mathbb{C}$ given by $g(z)=f(\varphi^{-1}(z))$ for every $z\in\varphi(U)$.
This is the local expression of $f$ in the chart $(U,\varphi)$. Since $f$ is holomorphic on the complex manifold $X$, the definition of holomorphicity on a complex manifold gives that $g$ is holomorphic on $\varphi(U)$.
Now compare moduli. For every $z\in\varphi(U)$, the point $\varphi^{-1}(z)$ lies in $X$, so the maximality of $M$ gives
\begin{align*}
|g(z)|=|f(\varphi^{-1}(z))|\leq M.
\end{align*}
At the point $\varphi(q)$, we have
\begin{align*}
|g(\varphi(q))|=|f(q)|=M.
\end{align*}
Thus $|g|$ attains its maximum at an interior point of the connected open set $\varphi(U)$. The Maximum Modulus Principle for holomorphic functions on connected domains in $\mathbb{C}^n$ says that a holomorphic function whose modulus attains an interior maximum is constant on the domain. Applying that result to $g:\varphi(U)\to\mathbb{C}$, we conclude that $g$ is constant on $\varphi(U)$.
Since the constant value is
\begin{align*}
g(\varphi(q))=f(q)=f(p),
\end{align*}
we obtain $f=f(p)$ on $U$. Therefore $U\subset A$. Because $q\in A$ was arbitrary, every point of $A$ has an open neighbourhood contained in $A$, and hence $A$ is open in $X$.
[/guided]
[/step]
[step:Apply connectedness to conclude the level set is all of $X$]
We have shown that $A\subset X$ is nonempty, closed, and open. Since $X$ is connected, the only subsets of $X$ that are both open and closed are $\varnothing$ and $X$. Because $A\neq\varnothing$, we must have
\begin{align*}
A=X.
\end{align*}
Therefore $f(q)=f(p)$ for every $q\in X$. Setting $c:=f(p)\in\mathbb{C}$, we obtain $f(q)=c$ for every $q\in X$, so $f$ is constant.
[/step]