It's enough to show that the integral of $f$ along every circle is $0$. If the circle does not cross or touch one of the axes, you've got it. If crosses an axis, approximate it by two simple closed curves: one of the follows an arc of the circle until it's very close to the coordinate axis, then moves along a line close to the axis until it reaches the arc, then moves along that arc. The other does the same on the other side of the axis. The integrals along those two lines approximately cancel each other, because you assumed continuity, and the approximation can be made as close as you want by making the lines close enough to the axis, again because you assumed continuity. So in the limit, they cancel each other and the whole thing approaches the integral along the circle. So $$\lim\limits_{\text{something}\to\text{something}} 0=\text{what}?$$
If it merely touches an axis without crossing, the problem is simpler. If it crosses both axes, it's more complicated in details, but conceptually pretty much the same.
If I understand correctly, "the complement of a function $x(y)$" means the complement of its graph, that is, the set $\{x+iy:x\ne x(y)\}$. You assume that $F$ is continuous in some domain $\Omega$ (possibly $\mathbb C$) and is holomorphic (=analytic) on $\Omega\setminus \Gamma$, where $\Gamma$ is the graph of some continuous function. The question is: does it follow that $F$ is holomorphic in $\Omega$?
(Stated more succinctly: is $\Gamma$ removable for continuous holomorphic functions?)
In general, the answer is no. Here is why.
Let $x(y)$ be a continuous function on a closed interval whose graph $\Gamma$ has Hausdorff dimension $D>1$. Such functions exist: for example, see reference 6 in the Wikipedia article on the Weierstrass function. Pick $1<d<D$. By Frostman's lemma, there exists a finite positive measure $\mu$ with support contained in $\Gamma$ and with the growth bound
$\mu(B(z,r))\le r^{d}$ for all $z\in \mathbb C$ and $r>0$. Define
$$F(z)=\int_{\mathbb C}\frac{1}{z-\zeta}d\mu(\zeta)$$
By construction, the function $F$ is holomorphic on $\mathbb C\setminus \Gamma$. It also tends to zero as $z\to\infty$. Since $F$ is not identically zero, it cannot be extended to a holomorphic function on $\mathbb C$; such an extension would contradict Liouville's theorem.
It remains to show that $F$ is continuous at every point $p\in \Gamma$. Pick a small $\delta>0$ and write
$$F(z)=\int_{B(p,\delta)}\frac{1}{z-\zeta}d\mu(\zeta)+\int_{B(p,\delta)^c}\frac{1}{z-\zeta}d\mu(\zeta)=:F_1(z)+F_2(z) $$
The function $F_2$ is holomorphic in $B(p,\delta)$, and therefore continuous there. For $z\in B(p,\delta)$ the first term can be estimated from above by switching to polar coordinates and integrating by parts:
$$
|F_1(z)|\le \int_{B(p,\delta)}\frac{1}{|z-\zeta|}d\mu(\zeta)
= \int_0^\infty \mu(B(z,\rho)\cap B(p,\delta))\,\frac{d\rho}{\rho^2}
\\ \le \int_0^\infty \min(\rho,\delta)^d \,\frac{d\rho}{\rho^2} =
\int_0^\delta \rho^d \,\frac{d\rho}{\rho^2}+\int_\delta^\infty \delta^d \,\frac{d\rho}{\rho^2}=C\delta^{d-1}
$$
Since $\delta^{d-1}\to 0$ as $\delta\to 0$, the function $F_1$ is continuous at $p$. In fact, the estimate shows that it is Hölder continuous with exponent $d-1$. This relation between Hölder exponent and Hausdorff dimension is not accidental: see this thread and references quoted there.
However, the answer is yes if $x(y)$ is a Lipschitz function. That is, Lipschitz graphs are removable for continuous holomorphic functions. More generally, curves of finite length are removable for continuous holomorphic functions: this a theorem of Painlevé. See Analytic capacity and measure by Garnett (Springer LNM series, 297).
Best Answer
I shall prove a more general result for you, i.e. by replacing line segment with line. You are right, the idea is to use Morera's theorem. Note that (in the proof below) you can replace $\mathbb C$ by any domain $D$, the proof stays the same. If needed, the domain $D$ can be brought closer to the real line (so that I may assume $L$ is a subset of the real line) by means of translation; which is a homeomorphism. Lastly, I have used "holomorphic" instead of "analytic", but these are equivalent notions. The essence of the argument lies in how to use Morera's theorem, as you shall see. $\newcommand{\C}{\mathbb C}$ $\renewcommand{\Im}{\operatorname{Im}}$ $\renewcommand{\Re}{\operatorname{Re}}$
Without loss of generality, we may assume that $L$ is the real line. This can be arranged by means of an affine transformation. In fact, it is easy to see that the reasoning that follows works for any line $L$ in $\C$. In other words, it is affine-invariant. We shall use Morera's theorem to show that $f$ is entire.
In our case, $G = \C$. Let $T$ be a triangle (without interior) in $\C$. $\int_T f(z) dz = 0$ for every $T$ contained entirely in $\mathbb H_1 = \{z\in \C: \Im z > 0\}$ or $\mathbb H_2 = \{z\in \C: \Im z < 0\}$ by Cauchy's theorem. It remains to consider the case where $T$ intersects the real line. Decomposing $T$ into smaller triangles, it suffices to consider the case where $T$ has an edge on the real line. $\color{red}{^1}$ Without loss of generality, suppose $T$ lies in $\overline{\mathbb H_1}$. Let $T$ have vertices $A,B$ and $C$ as in the figure below. We can find a compact set $K \subset \C$ containing $T$. Since $f$ is continuous, $f(K)$ is compact, hence bounded. That is, there exists $M > 0$ such that $|f(z)| \le M$ for all $z\in K$.
Construct a line segment $B_\delta C_\delta$ parallel to $BC$, at height $\delta > 0$ above the base. Drop perpendiculars $B_\delta B_\delta'$ and $C_\delta C_\delta'$ on $BC$. $$\int_{ABC} f(z)\, dz = \int_{AB_\delta C_\delta} f(z)\, dz + \int_{B_\delta BC C_\delta} f(z)\, dz$$ By Cauchy's theorem, $$\int_{AB_\delta C_\delta} f(z)\, dz = 0$$ as $AB_\delta C_\delta$ lies entirely inside $\mathbb H_1$, where $f$ is holomorphic. So, $$\int_{ABC} f(z)\, dz = \int_{B_\delta BC C_\delta} f(z)\, dz$$ Since $\delta > 0$ is arbitrary, take limits as $\delta\to 0$. Then, $$\int_{ABC} f(z)\, dz = \lim_{\delta\to 0} \int_{B_\delta BC C_\delta} f(z)\, dz$$ Also, $$\int_{B_\delta BC C_\delta} f(z)\, dz = \int_{B_\delta B B_\delta'} f(z)\, dz + \int_{B_\delta B_\delta' C_\delta' C_\delta} f(z)\, dz + \int_{C_\delta C_\delta' C} f(z)\, dz$$ As $\delta\to 0$, $\operatorname{len} (B_\delta B B_\delta') \to 0$ and $\operatorname{len} (C_\delta C_\delta' C)\to 0$. We have $$\left| \int_{B_\delta B B_\delta'} f(z)\, dz \right| \le \sup_{z\in B_\delta B B_\delta'} |f(z)| \operatorname{len}(B_\delta B B_\delta') \le M \operatorname{len}(B_\delta B B_\delta') \xrightarrow{\delta\to 0} 0$$ and $$\left| \int_{C_\delta C_\delta' C} f(z)\, dz \right| \le \sup_{z\in C_\delta C_\delta' C} |f(z)| \operatorname{len}(C_\delta C_\delta' C) \le M \operatorname{len}(C_\delta C_\delta' C) \xrightarrow{\delta\to 0} 0$$ Moreover, $$\int_{B_\delta B_\delta' C_\delta' C_\delta} f(z)\, dz = \int_{B_\delta' C_\delta'} f(z)\, dz + \int_{C_\delta B_\delta} f(z)\, dz + \int_{B_\delta B_\delta'} f(z)\, dz + \int_{C_\delta' C_\delta} f(z)\, dz$$ As $\delta\to 0$, $\operatorname{len}(B_\delta B_\delta') \to 0$ and $\operatorname{len}(C_\delta' C_\delta) \to 0$. We have $$\left|\int_{B_\delta B_\delta'} f(z)\, dz \right| \le \sup_{z\in B_\delta B_\delta'} |f(z)| \operatorname{len}(B_\delta B_\delta') \le M \operatorname{len}(B_\delta B_\delta') \xrightarrow{\delta\to 0} 0$$ and $$\left|\int_{C_\delta' C_\delta} f(z)\, dz \right| \le \sup_{z\in C_\delta' C_\delta} |f(z)| \operatorname{len}(C_\delta' C_\delta) \le M \operatorname{len}(C_\delta' C_\delta) \xrightarrow{\delta\to 0} 0$$ Lastly, $$\int_{B_\delta' C_\delta'} f(z)\, dz + \int_{C_\delta B_\delta} f(z)\, dz \xrightarrow{\delta\to 0} 0$$ as the segments $B_\delta C_\delta$ and $B_\delta' C_\delta'$ both approach $BC$, as $\delta\to 0$.$\color{red}{^2}$ Therefore, $$\int_{ABC} f(z)\, dz = \lim_{\delta\to 0} \int_{B_\delta BC C_\delta} f(z)\, dz = 0$$ We conclude that $$\int_T f(z)\, dz = 0$$ for every triangle in $\C$. By Morera's theorem, $f$ is holomorphic on $\C$, i.e. $f$ is entire.
Footnotes:
$\color{red}{1.}$ This argument is standard; see, for example, the proof of Schwarz Reflection Principle.
$\color{red}{2.}$ A similar argument is seen in the proof of Cauchy's integral formulae (the keyhole contour construction).
Related Posts: See Post 1, Post 2.