How to show that the following function is analytic using the Morera theorem

analysisanalytic-functionscomplex-analysis

Let $f:\Bbb{C}\rightarrow \Bbb{C}$ be a continuous function which is analytic on $\Bbb{C}\setminus \Bbb{R}$. I need to use the Morera theorem to show that $f$ is analytic on $\Bbb{C}$.

In the lecture the Prof. gave us the hint that we should decompose rectangle into three rectangles.

Up to now I have done the following:

Let $z_0\in \Bbb{C}$. Take $B_r(z_0)\subset \Bbb{C}$ be an open disk. By assumption $f$ is continuous on $B_r(z_0)$. Let me define $R$ to be an arbitrary closed rectangle in $B_r(z_0)$. Now to conclude I only need to show that $$\int_{\partial R} f(z) dz=0$$ Here I think I need the hint but I don't see how it works.

Could maybe someone help me?

Thanks for your help

Best Answer

Hint: if the rectangle is contained in the upper half or lower half plane, the integral vanishes since $f$ is holomorphic on $\Bbb{C}\setminus \Bbb{R}$. An arbitrary rectangle can be split into three parts, only one of which intersects $\mathbb{R}$. The integral over this part can be made arbitrarily small by shrinking this rectangle.