Every point of discontinuity of a function $f$ is a removable discontinuity. Prove that $g(x)=\lim_{y\to x}f(y)$ is continuous. Problem statement: Let $f$ be a function with the property that every point of discontinuity is a removable discontinuity. So, $\lim_{y \to x}f(y)$ exists for all $x$, but $f$ may be discontinuous at some (even infinitely many) numbers $x$. Define $g(x)= \lim_{y\to x}f(y)$. Prove that $g$ is continuous.

First, consider the case when $f$ is continuous at $a$.
By definition of $g$, and continuity of $f$ at $a$, we have
$$g(a)=\lim_{x \rightarrow a} f(x) = f(a).$$
So, if $f$ is continuous at $a$, $g(a)=f(a)$.  
Now consider the case where $f$ is not continuous at $a$. By definition of $g$, $$g(a)=\lim_{x \rightarrow a} f(x),$$ $$ \forall\epsilon>0,\ \exists\delta_f,\ \forall x, \ 0<|x-a|<\delta_f\Rightarrow |f(x)-g(a)|<\epsilon.$$

My question is: The problem statement says that there are "infinitely many" points of discontinuity. Not sure how to interpret this exactly.
Can I define some $\delta_{min}$ to be the distance to the closest point of discontinuity from $a$? Is there such a point?

And then take $\delta_g=\min(\delta_f, \delta_{min})$. Now, $$ \forall\epsilon>0,\ \ \forall x, \ 0<|x-a|<\delta_g\Rightarrow |f(x)-g(a)|<\epsilon,$$
and since $f$ is continuous at all these $x$'s, we have $g(x)=f(x)$, and so$$ \forall\epsilon>0,\ \ \forall x, \ 0<|x-a|<\delta_g\Rightarrow |g(x)-g(a)|<\epsilon.$$
Which completes the proof.
 A: Your approach seems honest but not correct. If two functions agree at a point $a$ and one of them is continuous at $a$ then it does not mean that the other is also continuous at $a$. Why?? Because continuity is not just about the behavior of a function at a point  but about its behavior in some neighborhood of that point. When $f$ is continuous at $a$ and $g(a) =f(a) $ then you have information on behavior of $f$ in some neighborhood of $a$ but you have no information about behavior of $g$ at any point other than $a$.
Thus your argument does not work for the case when $f$ is continuous at $a$. Also you don't handle the case when $f$ is discontinuous at $a$.
Better approach is to deal with both cases simultaneously. Let $a$ be the point under consideration and let $\epsilon>0$ be given. Since $\lim_{x\to a} f(x) =g(a) $ it follows that there is a $\delta>0$ such that $$g(a) - \epsilon<f(x) <g(a) +\epsilon$$ for all $x$ with $0<|x-a|<\delta$. If $t\neq a$ is any number in $(a-\delta, a+\delta) $ then we can take limit of the above inequality as $x\to t$ and get $$g(a) - \epsilon \leq \lim_{x\to t} f(x) \leq g(a) +\epsilon$$ ie $$g(a) - \epsilon \leq g(t) \leq g(a) +\epsilon $$ for all $t$ with $t\neq a$ and $t\in(a-\delta, a+\delta) $ and the inequality trivially holds for $t=a$. This proves that $g$ is continuous at $a$. The job is done!! 
A: Apparently you work in a metric context. In that case, continuity is a pointwise statement. A function is said to be continuous if it is continuous at each point.
If you take a point where $f$ is continuous, you can easily check that $g$ is too. If you take a point where $f$ has a removable discontinuity point, show that it is a point of continuity for $g$.
In your proof, you are trying to prove that $g$ is uniformly continuous (i.e that you $\delta$ does not depend on the point you consider) : in that case, the result is false, for example, take $f(x) = x^2$ for $x \neq 0$ and $f(0) = 1 $. Then $g(x) = x^2$ for all $x$ but is not uniformly continuous.
