Claim: Let $D$ be a domain, let $C$ be a simple closed contour in $D$, f is analytic in $D/C$ and continuous in $D$, then $f$ is analytic in $D$.
I tried to show the contour integrals of $f$ in $D$ are zero and then by Morera's theorem, we can have the desired conclusion. For closed contour $\Gamma$ that does not cross with the given $C$, $\int_\Gamma f(z)dz=0$ by Cauchy-Goursat theorem, however, I don't quite have a clear picture on how to deal with the contours that does intersects with $C$. Any ideas on how I might continue my method or other ways to tackle the problem are much appreciated.
Quick answer:
Explanation:
This claim, though it may seem naturally true, is actually quite complicated, without some kind of additional hypotesis other than the contour being a Jordan closed contour (and this is usually a ** of many textbooks in complex analysis). Let us state some results:
A compact set $K\subset \mathbb{C}$ is said to be removable if your statement holds, i.e. if, for every domain $D$ containing $K$, the set of functions analytic on $D$ is equal to the set of functions analytic on $D-K$ and continuous on $D$. This definition is strictly related to the concept of (continuous) analytic capacity , as you can see here and here. In particular, a theorem of Painlevé states that a rectifiable curve $\gamma$ is a removable set, while if the area of the curve is positive, the set is non-removable. For a proof of both statements, see "null sets for a class of analytic functions" by Zalcman.
As much as the concept of a curve with positive area is counterintuivite, this condition rules out the possibility of keeping the hypotesis on the contour as a jordan curve: in fact, there exists jordan curves and jordan arcs (called Osgood curves) with positive area (see here for more informations), and which are thus non removable.
I suppose the author of your exercise has tacitly assumed (or maybe has stated before) some properties of contours: for example, if the contour is "nice": for example, if we assume that every line intersect the curve in at most a finite number of points (this is true, for example, if the contour is an analytic curve), Morera's theorem (for triangles) is enough to show analyticity. Obviously such a requirement is very restrictive (even if it is geometrically quite intuitive): e.g., there exists $C^{\infty}$ curves which do not satisfy this requirement: $$\gamma(t)=\pmatrix{t\\ \sin\left(\frac{1}{t^2}\right)e^{-\frac{1}{t^2}}}$$
intersects the line $y=0$ in a countable set of points
Note: by area, I mean lebesgue measure on the plane