I am working on the following problem:
Suppose $f$ is analytic on a bounded domain U and that $$\limsup_{U\ni z\to w} |f(z)| \leq K \quad (\dagger)$$ for each $w \in \partial U$. Show that $|f(z)| \leq K$ for each $z \in U$.
I came up with the following: Let $L>K$ and consider $V = \{z \in U : |f(z)| >L\}$. Then, since $V \subseteq U$, so $\bar{V} \subseteq \bar{U}$. But suppose that $w \in \bar{V} \cap \bar{U}$, then $\exists (z_n)_{n=1}^{\infty} \in V$ such that $(z_n)_{n=1}^{\infty} \to w$, implying $\forall \epsilon > 0 \> \exists y \in B_{\epsilon}(w)$ such that $f(y) \geq L>K$, contradicting the assumption $(\dagger)$, implying $\bar{V} \cap \bar{U} = \emptyset$, thus $\bar{V} \subseteq U$. Since $f$ analytic, so continuous, $V$ open. Let $W$ be a connected component of $V$. Then $f(\partial W)=L < f(z)$ for any $z \in W$, contradicting the maximum modulus principle.
My questions are: Is my proof correct? The exercise also provides the following hint:
Show that $\bar{V}$ is a compact subset of $U$.
Which I believe follows from the fact that $\bar{V} \subseteq U$ and that $\bar{V}$ is compact in $\mathbb{C}$. This would imply that $f$ achieves its exterma on $\bar{V}$, but I am not sure how to finish this line of argument. Could someone help with finishing this argument?
In the light of @Quoka's comment, I will finish the proof using the compactness of $\bar{V}$.
Since $\bar{V} \subseteq U$ and is a closed, bounded subset of $\mathbb{C}$, thus it is a compact subset of $U$. Further, since $f$ is analytic, so continuous on $U$, $f$ achieves its maximum on $\bar{V}$, say at a point $z_0 \in \bar{V}$ - i.e. $f(z_0) > L$. Let $W$ be a connected component of $V$, such that $z_0 \in \bar{W}$. Then by the maximum modulus principle $z_0 \in \partial W$, but as noted in the original post, $f(\partial W)=L$, contradicting $f(z_0) >L$.