From Ahlfors' Complex Analysis (by 'analytic' he means 'complex-differentiable' or 'holomorphic'; he does not mean that the function can be expanded as a power series, as that is what he sets out to prove):
Theorem 7. Suppose that $f(z)$ is analytic in the region $\Omega'$ obtained by omitting a point $a$ from a region $\Omega$. A necessary and sufficient condition that there exist an analytic function in $\Omega$ which coincides with $f(z)$ in $\Omega'$ is that $\lim_{z\to a}(z - a)f(z) = 0$. The extended function is uniquely determined.
At the beginning of the proof, he writes:
To prove the sufficiency we draw a circle $C$ about $a$ so that $C$ and its inside are contained in $\Omega$. Cauchy's formula is valid, and we can write $$f(z) = \frac{1}{2\pi i}\int_C\frac{f(\xi)}{\xi - z}\text{d}\xi$$ for all $z \ne a$ inside of $C$.
How and why does Cauchy formula apply here? From my understanding, the function $f$ needs to be holomorphic (and thus defined) in the entirety of an open disk. As Ahlfors wrote a few pages back:
We have thus proved: Theorem 6: Suppose that $f(z)$ is analytic in an open disk $D$, and let $\gamma$ be a closed curve in $D$. For any point $a$ not on $\gamma$ $$n(\gamma,a)\cdot f(a) = \frac{1}{2\pi i}\int_\gamma\frac{f(z)}{z-a}\text{d}z$$ where $n(\gamma,a)$ is the index [winding number] of $a$ with respect to $\gamma$.
Immediately proceeding Ahlfors's Theorem 6:
Here Theorem 5 reads as:
Here (18) is the following: $$ \int_\gamma f(z) \, d z = 0. \tag{18} $$