The hypothesis
$\vert f(z) \vert = \vert f(w) \vert \tag{1}$
for all $z, w \in B(0, \epsilon)$ indicates that $\vert f(z) \vert$ is constant on $B(0, \epsilon)$. Thus if
$\vert f(0) \vert = 0, \tag{2}$
then
$\vert f(z) \vert = 0 \tag{3}$
for all $z \in B(0, \epsilon)$, whence
$f(z) = 0 \tag{4}$
on $B(0, \epsilon)$ as well; we thus see that $f(z)$ is constant on $B(0, \epsilon)$, $0$ being the most constant of all constants, as it were. On the other hand, if
$\vert f(0) \vert \ne 0, \tag{5}$
then
$\vert f(z) \vert = \vert f(0) \vert \ne 0 \tag{6}$
on $B(0, \epsilon)$, so
$f(z) \ne 0 \tag{7}$
on $B(0, \epsilon)$ as well; thus $(f(z))^{-1} = 1 / f(z)$ is well -defined, and both it and $f'(z)$ are holomorpic on $B(0, \epsilon)$, as is $f'(z) / f(z)$; it then follows that the function
$\int_0^z \dfrac{f'(w)}{f(w)}dw \tag{8}$
is holomorphic in $B(0, \epsilon)$, as is
$g(z) = \exp(\int_0^z \dfrac{f'(w)}{f(w)} dw). \tag{9}$
We note that
$g(0) = \exp(\int_0^0 \dfrac{f'(w)}{f(w)} dw) = \exp(0) = 1, \tag{10}$
and that
$g(z) \ne 0 \tag{11}$
for $z \in B(0, \epsilon)$, since $g(z)$ is the exponential of a holomorphic function. We compute $g'(z)$:
$g'(z) = \dfrac{f'(z)}{f(z)} \exp(\int_0^z \dfrac{f'(w)}{f(w)} dw)$
$= \dfrac{f'(z)}{f(z)}g(z), \tag{12}$
and thus observe that (12) yields
$g'(z)f(z) = f'(z)g(z), \tag{13}$
or
$f'(z)g(z) - f(z)g'(z) = 0. \tag{14}$
By (11), we can form the function $f(z) / g(z)$; it too is holomorphic in $B(0, \epsilon)$, and
$(\dfrac{f(z)}{g(z)})'$
$= \dfrac{f'(z)g(z) - f(z)g'(z)}{(g(z))^2} = 0, \tag{15}$
by (14); thus $f(z) / g(z)$ is some constant $c \in \Bbb C$, so we may write
$f(z) = cg(z); \tag{16}$
using (10), we see that
$f(0) = cg(0) = c,\tag{17}$
so that
$f(z) = f(0)g(z). \tag{18}$
We now write the function (8) in terms of its real and imaginary parts as
$\int_0^z \dfrac{f'(w)}{f(w)}dw = u(z) + iv(z), \tag{19}$
where $u(z)$ and $v(z)$ are real valued functions of $z \in B(0, \epsilon)$; we then see that
$g(z) = \exp(\int_0^z \dfrac{f'(w)}{f(w)} dw)$
$= \exp(u(z) + iv(z)) = e^{u(z) + iv(z)} = e^{u(z)} e^{iv(z)}, \tag{20}$
whence
$f(z) = f(0) e^{u(z)} e^{iv(z)}; \tag{21}$
taking moduli:
$\vert f(z) \vert = \vert f(0) \vert \vert \vert e^{u(z)} \vert e^{iv(z)} \vert$
$= \vert f(0) \vert \vert e^{u(z)} \vert, \tag{22}$
since $\vert e^{iv(z)} \vert = 1$; thus by (6),
$e^{u(z)} = \vert e^{u(z)} \vert = 1, \tag{23}$
yielding
$u(z) = 0; \tag{24}$
now by Cauchy-Riemann,
$v_x = -u_y = 0, \tag{25}$
$v_y = u_x = 0; \tag{26}$
we see that $\nabla v = 0$, implying $v(z)$ is constant as well. Setting $z = 0$ in (21) and using (24) we have
$f(0) = f(0)e^0e^{iv(0)}, \tag{27}$
or
$e^{iv(0)} = 1; \tag{28}$
these considerations lead us to conclude that
$v(z) = v(0) = 2 k \pi \tag{29}$
for $z \in B(0, \epsilon)$ and some fixed $k \in \Bbb Z$. Again using (21) we have
$f(z) = f(0) e^0 e^{2k\pi i} = f(0) \tag{30}$
for all $z \in B(0, \epsilon)$; we see that $f(z)$ is indeed constant. QED.