Let f be analytic on an open set U. Let $z_0$ a member of $U$ be a maximum for $|f|$, that is, $|f(z)_)\geq|f(z_0)$, for all $z$ members of $U$. Then $f$ is locally constant at $z_0$
Since $f$ is analytic we have $f= a_0 + a_1(z-z_0)+....$
We proof this through contradiction.
If $f$ is not constant $a_0=f(z_0)$ then by the Open Mapping Theorem we know $f$ is an oppen mapping thus the image of $f$ contains a disc $D(a_0,s)$. Hence the set of numbers $|f(z)|$, for z in a neighbourhood of $z_0$, contains an open interval around $a_0$ s.t. $f(z)>f(z_0)$. But thats a contradiction hence $f$ is locally constant at $z_0$.
Let $f,g,$ be analytic on $U$. Let $S$ be a set of points in $U$ which is not discrete. Assume that $f(z)=g(z)$ for all $z$ in $S$. Then $f=g=$ on $U$.
The proof is found in many textbooks (such as Serge Lang's Complex Analysis) and I think is known to OP but if needed I can provide it.
Maximum Modulus Principle Statement:
Let $U$ be a connected open set, and let $f$ be an analytic function on $U$. If $z_0<U$ is a maximum point for $|f|$, that is $|f(z_0)|\geq|f(z)|$ for all $z∈U$, then $f$ is constant on $U$
Now for proving the maximum modulus principle, by Proposition 1 we have $f$ locally constant at $z_0$. Then by Proposition 2 $f$ is constant on $U$ (compare $f$ with the constant function)