Solution (source code)

= Solution

For $0\le t\le1$, put $F_t=f+tg$. On the curve, $|F_t|\ge|f|-t|g|>0$, so no member of this homotopy has a boundary zero. The <argument principle> counts the interior zeros, with <multiplicity>, by its winding number $N(t)=\operatorname{wind}(F_t\circ\gamma,0)$. For a piecewise smooth curve this is
$$
N(t)=\frac1{2\pi i}\int_\gamma\frac{F_t'(z)}{F_t(z)}\,dz.
$$
There are no poles, and the null-homotopy of the Jordan curve in the domain permits this interior count. The loops $F_t\circ\gamma$ form a continuous homotopy avoiding zero, so their integer winding number stays constant. Equivalently, for a piecewise smooth curve the integral varies continuously with $t$ and is integer-valued. In particular
$$
\boxed{N(f)=N(f+g)}.
$$
This proves <Rouché's theorem>. The counting is with <multiplicity> and assumes the usual positive orientation; reversing orientation reverses both winding counts without changing the conclusion.