Define
$$
h(z) = \begin{cases} f(z), & |z|\le 1 \\ g(z), & |z| > 1. \end{cases}
$$
By assumption, $h$ is continous on $\mathbb{C}$, so by Morera's theorem, it suffices to check whether
$$
\int_\gamma h(z)\,dz = 0
$$
for all closed curves $\gamma$. In fact, it is enough to check that the integral vanishes for all triangles.
Let $\gamma$ be an arbitrary triangle. There are a few cases to consider. If $\gamma$ encloses the unit disc, it follows by deformation of contours that
$$
\int_\gamma h(z)\,dz = \int_{|z| = 1} h(z)\,dz = \int_{|z| = 1} f(z)\,dz = 0
$$
by Cauchy's integral theorem. Similarly, if $\gamma$ is in the interior of the unit disc, the integral vanishes again by Cauchy's integral theorem.
Finally, if the triangle intersects the unit circle, we can write the triangle as the union of a number of curves lying completely inside or completely outside the unit disc. These curves consist of line segments that together form the original triangle together with arcs along the circle traversed twice; once in each direction. All in all, the integral along each such closed curve vanishes, yet again by Cauchy's integral theorem, so our $h$ is indeed an entire function.
Note: we need a version of Cauchy's integral theorem valid for functions holomorphic on (or outside) the unit disc, continous up to the boundary. Not all textbooks prove this version, but it's fairly straight-forward.