How can I show that if $f:\mathbb{C}\to\mathbb{C}$ is a continuous function such that $f$ is holomorphic (or analytic) in $U=\{z\in\mathbb{C}:\operatorname{Im} z\neq0\}$, then $f$ is holomorphic in the whole $\mathbb{C}$.
Any hint would be really appreciated!