Consider the argument principle $\frac{1}{2\pi i}\oint_{\partial G}\frac{f'(z)}{f(z)}\ dz = N-P$ where $N$ is the number of zeroes and $P$ the number of poles. We know that $f$ is holomorphic inside $G$ so $P=0$. Equivalently, $\frac{1}{2\pi i}\oint_{\partial G}\frac{f'(z)}{f(z)-a}\ dz = N_a$ is the number of times $f(z) - a$ takes on $0$ in $G$, i.e. the number of times $f(z)$ takes on the value $a$ in $G$. But this is the same as rewriting the integral as $\frac{1}{2\pi i}\oint_{f(\partial G)}\frac{1}{t-a}\ dt$ which is the winding number of $f(\partial G)$ about the point $a$. What can you say about the winding numbers of points in a connected component?
Proof of the fact that the winding number is constant on a connected component.
Theorem: The winding number is locally constant. Let $\gamma: [t_1,\ t_2]\rightarrow U$ be a (piecewise) continuously differentiable curve in an open set $U$. The map $g:\ U\setminus{\mathrm{Im}(\gamma)}\rightarrow \mathbb{Z}$ given by $g(w) = \mathrm{Wnd}(\gamma,\ w) = \frac{1}{2\pi i}\oint_{\gamma}\frac{dz}{z-w}$ is constant on each connected component of $U\setminus{\mathrm{Im}(\gamma)}$. The notation $\mathrm{Wnd}(\gamma,\ w)$ denotes the winding number of the curve $\gamma$ about the point $w$.
Proof: The interval $[t_1,\ t_2]$ is closed and bounded and hence compact. Since $\gamma$ is continuous, that means $\mathrm{Im}(\gamma)$ is also compact. Therefore $U\setminus{\mathrm{Im}(\gamma)}$ is open. Choose $r>0$ so that the $D(a,\ 2r)$, the open disk centered at $a$ of radius $2r$ is fully contained in $U\setminus{\mathrm{Im}(\gamma)}$. Choose $w$ in $D(a,\ r)$. Then $\begin{aligned}\left|g(w) - g(a)\right| &= \left|\frac{1}{2\pi i}\oint_{\gamma}\frac{dz}{z-w} - \frac{1}{2\pi i}\oint_{\gamma}\frac{dz}{z-a}\right| \\ & =\frac{1}{2\pi}\left|\oint_\gamma \frac{w-a}{(z-a)(z-w)}\ dz\right| \\ & \le \frac{1}{2\pi}\mathrm{length}(\gamma)\sup_{z\in \mathrm{Im}(\gamma)}\frac{|w-a|}{|z-a||z-w|} \\ & \le \frac{1}{2\pi}\mathrm{length}(\gamma)\frac{|w-a|}{2r^2}\end{aligned}$ It is clear then that $|g(w)-g(a)| \rightarrow 0$ as $|w \rightarrow a|$ and hence $g$ is a continuous function on each connected component of $U\setminus{\mathrm{Im}(\gamma)}$. Since $g$ is continuous, if $V$ is a connected component, then $g(V)$ is also connected. But $g$ is a map to the integers, so that necessarily means that $g$ is constant for each connected component. $\square$