Proving that a function with only removable discontinuities can be made continuous

calculuscontinuityepsilon-deltalimitssolution-verification

I'm working with Spivak's "Calculus" and was doing the following problem:

Let $f$ be a function with the property that every discontinuity is a removable discontinuity. This means that $\lim_{y\to x}f(y)$ exists for all $x$. Let $g(x):= \lim_{y\to x}f(y)$. Prove that $g$ is continuous.

I don't have access to the solution's manual at the moment, so I'm not sure of the proof given by Spivak. However, after thinking for a while, I came up with the following proof (which, if correct, I'm pretty sure is a huge overkill since the proof shouldn't be so long). In this proof, I use the fact that you can find a punctured neighbourhood around every point for which f is continuous. I wanted to know whether this specific argument is correct and, if not, why does my reasoning for it fail in the proof? For this proof, I've made use of the local property of limits, which can be framed as the following:
$$\text{If there exists}\;\delta\;\text{s.t.}\;|x – a| < \delta\implies f(x) = g(x)\;\text{then}\;\lim_{x\to a}f(x) = \lim_{x\to a}g(x)$$
Proof:

Let $x_0$ be an arbitrary point. My general strategy is to show that if for all points the limit exists (which is the case for $f$), you can find a range around every point such that the function is continuous for every point in this range. So, since $x_0$ is an arbitrary point, I want to show that I can find a range $|x-x_0| < \delta$ such that $\lim_{y\to x}f(y) = f(x)$ provided that $x\neq x_0$. If this is true, then $f(x) = g(x)$ for $|x-x_0| < \delta$ (except $x_0$). Then, use the local property of limits to show that $\lim_{x\to x_0}f(x) = g(x_0) = \lim_{x\to x_0}g(x)$.

So, all I have to show is that there exists a $\delta$ such that $|x – x_0| < \delta\implies \lim_{y\to x}f(y) = f(x)$.

Since every point has a limit, there exists a $\delta_1$ such that $|x – x_0| < \delta_1\implies |f(x) – L_1| < \epsilon$ (call this statement $S_1$). Furthermore, the limit exists at $x$. Therefore, $|y – x| < \delta_2\implies |f(y) – L_2| < \epsilon$ (call this statement $S_2$). We'll be done if it can be showed that $L_2 = f(x)$.

To link $S_1$ and $S_2$, we must further constraint $y$ so that it is also within $(x_0-\delta_1,x_0+\delta_1)$. This can be done by defining $\delta_3 = min(\delta_2,x-(x_0-\delta_1),(x_0+\delta_1)-x)$. Now, $|y – x| < \delta_3\implies |f(y) – L_2|$. For such a $y$, since it is within $\delta_1$ of $x_0$, we can say that $|y – x_0| < \delta_1\implies |f(y) – L_1| < \epsilon$ (call this statement $S_3$).

Finally, use $S_1$ and $S_2$ in conjunction. Notice that $|y – x + x – x_0| = |y – x_0|\leq |y – x| + |x – x_0|$. But, $|y – x| < \delta_2$ and $|x – x_0| < \delta_1\implies |y – x| + |x – x_0| < \delta_1 + \delta_2$. Therefore, $|y – x_0| \leq |y – x| + |x – x_0| < \delta_1 + \delta_2$. So, $|x – x_0| < \delta_1, |y – x| < \delta_2\implies |y-x_0| < \delta_1+\delta_2$.

Furthermore, $|x – x_0| < \delta_1, |y – x| < \delta_2\implies |f(x) – L_1| < \epsilon, |f(y) – L_2| < \epsilon$. But, $|f(x) – L_1| < \epsilon\implies |f(x) – L_1| < \frac{\epsilon}{2}, |f(y) – L_2| < \frac{\epsilon}{2}$. This further implies that $|f(x) – L_1 + f(y) – L_2|\leq |f(x) – L_1| + |f(y) – L_2| < \epsilon$. Therefore, $|x – x_0| < \delta_1, |y – x| < \delta_2\implies |y – x_0| < \delta_1 + \delta_2\land |f(x) – L_1 + f(y) – L_2| < \epsilon$.

Thus, $\lim_{y\to x_0} f(y) = L_2 + L_1 – f(x)$. However, by $S_3$, $\lim_{y\to x_0} f(y) = L_1$. Since a limit cannot be different values, $f(x) = L_2$. QED

EDIT EXPLANATION: According to @XanderHenderson my question does not meet the requirements of the solution verification tag because I'm not asking verification for a specific piece of my argument. So, now, I'm explicitly asking for someone to verify the "specific argument" that you can find a punctured neighbourhood around every point for which f is continuous. If not, kindly point out why my reasoning fails.

Best Answer

Your proof tries to show that $f$ is continuous near every point of discontinuity. But here is one where it is not.
Take the function where $f(x)=0$ for irrational $x$, and $f(p/q)=1/q$ for rational numbers. Then $\lim_{y\to x}f(y)=0$ for every $x$. You can make $f(x)$ continuous at $x=p/q$ by replacing just $f(p/q)$ with $0$, so every discontinuity is removeable, but it is still discontinuous at every other rational point except $x=0$.

EDIT
Once you have chosen $\epsilon$ and $\delta_1$, you can't prove that $f(y)-f(x)$ is any smaller than that $\epsilon$. So you can't show $\lim_{y\to x}f(y)=f(x)$. You can shrink $\epsilon$, but then you have to shrink $\delta_1$, and $x$ may no longer be in the interval.

Related Question