If $f$ has only removable discontinuities, show that $f$ can be adjusted to a continuous function I was working on this problem from Spivak's text, and I thought I'd post my answer, in case someone can improve on it. In particular, I wonder if there is a proof that can generalize to topological spaces more generally (since I have used second countability in working with sequences).
Suppose $f:\mathbb{R}\to \mathbb{R}$ is such that each discontinuity of $f$ is removable, i.e. $\lim_{y\to x}f(y)$ exists for all $x$. Define $g(x) := \lim_{y\to x}f(x)$. Show that $g$ is continuous.
 A: Suppose $g$ is discontinuous at $x_0$. Then there exists a sequence $x_n \to x_0$ and there exists $\epsilon>0$ such that $|g(x_n)-g(x_0)|>\epsilon$. For each $x_n$ choose any sequence $x_n^i \xrightarrow{i\to\infty} x_n$. Then the definition of $g$ implies that $f(x_n^i) \xrightarrow{i\to\infty} g(x_n)$. Take $x_n^{i_n}$ such that $|f(x_n^{i_n})-g(x_n)|<\epsilon/2$ and $|x_n^{i_n}-x_n|< 1/n$. Now $x_n^{i_n}\xrightarrow{n\to\infty} x_0$ but $f(x_n^{i_n})\not\to g(x_0)$, a contradiction.
A: I think your proof is definitely correct but I don't think there is any need to use sequences. In fact, the generalization of sequences to arbitrary (not necessarily first countable) topological spaces is "nets". Sequences provide another way of formulating many definitions and results for "nice" (e.g., first countable, Hausdorff etc.) spaces, but don't generally yield further insight in such cases.
In this case, we can directly appeal to the definition of continuity. If $\epsilon>0$, then choose $\delta$ such that $0<\left|y-x\right|<\delta$ $\implies$ $\left|f(y)-g(x)\right|<\epsilon$. (We can do this by the definition of the limit, $g(x)$.) Now observe that if $\left|y-x\right|<\delta$, then $\left|g(y)-g(x)\right|<\epsilon$. Since $\epsilon>0$ was arbitrary, $g$ is continuous at $x$. (On the other hand, continuity of $g$ at points $\neq x$ is immediate.)
Exercise 1: Generalise this result to the case of a function $f:X\to Y$ where $X$ and $Y$ are arbitrary topological spaces (with no further conditions such as first countability - it will be necessary to suitably define the notion of "limit" in this general context (without the use of sequences) but it is possible).
Exercise 2: If $f:\mathbb{R}\to \mathbb{R}$ is differentiable except at $x\in \mathbb{R}$, and $\lim_{y\to x} \frac{f(y)-f(x)}{y-x}$ exists, then prove that $f$ can be "adjusted to a differentiable function". 
Hope this helps!
