Solution (source code)

= Solution

Choose $z_+,z_-\in\mathbb C$ with
$$
f(z_+)>0,\qquad f(z_-)<0.
$$
Restrict $f$ to the <line segment> between them:
$$
h(t)=f\bigl((1-t)z_-+tz_+\bigr),
\qquad 0\leq t\leq1.
$$
This is continuous, with $h(0)<0<h(1)$. The <intermediate value theorem> gives a $t_0$ with $h(t_0)=0$. Therefore
$$
z=(1-t_0)z_-+t_0z_+
$$
is the required <zero on a line segment>.