This is exercise 1, page 101 of Michael Taylor's Introduction to Complex Analysis, which you may find here.
Statement: Let Ω ⊂ C be a connected domain. Suppose γ is a smooth curve in Ω, and Ω \ γ has two connected pieces, say Ω±. Assume g is continuous on Ω, and holomorphic on Ω+ and on Ω−. Show that g is holomorphic on Ω. Hint. Verify the hypotheses of Morera’s theorem.
My proof idea: We assume without loss of generality in the following that $\gamma$ is defined on $[0,1]$ (if it is not we may reparametrize it).
We aim to verify the hypotheses of Morera's theorem. To this end consider a rectangle $R \subseteq \Omega$. Clearly there is nothing to do if $R \subseteq \Omega_+$$R \subseteq \Omega_-$; $g$ is holomorphic on these regions so the contour integral is $0$ as a consequence of Cauchy's integral theorem.
Suppose then that $R$ intersects $\gamma$ and let $O$ be some compact set that contains $\gamma$. In the following let $P_n = \{t_{k,n}\}$ be the standard partition of $[0,1]$: $t_{k,n} = \frac{k}{n}$ for $0 \le k \le n$. The path $\gamma$ is smooth, and so in particular it is Lipschitz so we have for all $k$: \begin{equation*} \vert \gamma(t_{k+1, n}) - \gamma(t_{k, n}) \vert \le C \vert t_{k+1, n} - t_{k, n} \vert \le C \frac{1}{n}. \end{equation*} In particular this means that the path segment $\gamma \colon t \in [t_{k, n}, t_{k+1, n}]$ is contained in a rectangle $R_{k,n}$ with sides of length inferior or equal to $\frac{C}{n}$.
Write \begin{align*} R_+ &= \left ( R \setminus \left ( \bigcup_{k=0}^n R_{k,n} \right ) \right ) \cap \Omega_+ \\ R_- &= \left ( R \setminus \left ( \bigcup_{k=0}^n R_{k,n} \right ) \right ) \cap \Omega_-. \end{align*} So $R_+$ is the part of $R$ lying in $\Omega_+$ from which we have removed the rectangles $R_{k,n}$, and vice-versa for $R_-$. With a little effort of imagination we see that: \begin{equation*} \int_{\partial R} g = \int_{\partial R_+} g + \int_{\partial R_-} + \sum_{k = 0}^{n} \int_{\partial R_{k,n}} g. \end{equation*}
The first two integrals are $0$ as a consequence of the Cauchy integral theorem. Then we may bound the sum in the following manner: \begin{align*} \vert \sum_{k = 0}^{n} \int_{\partial R_{k,n}} g \vert &\le \sum_{k = 0}^{n} \sup_{\partial R_{k,n}} \vert g \vert \cdot \ell (\partial R_{k,n}) \\ &\le \sum_{k = 0}^{n} \sup_{\partial R_{k,n}} \vert g \vert \cdot \frac{4C}{n}. \end{align*}
But here I meet a big obstacle; there are n terms in my sum that are all of the shape 1/n, so this does not let me conclude that everything converges to $0$...
I'm a bit stumped on how to proceed and if this is even the right idea so I would really appreciate any pointers.
