A function with only removable discontinuities In this question that I asked, a helpful user ended his answer with two exercises. I'm not sure what he was intending with them. In particular, the second one seems ill-posed. Is anyone able to discern his meaning?
 A: Concerning the second exercise
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".
I agree with you that the exercise is not well formed. Such a function is already differentiable; no adjustment needed.

The first exercise was a suggested generalization of

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.
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).

I interpret the limit condition as follows: for every $x\in X$ there is a unique $y\in Y$ such that for every neighborhood $V$ of $y$ there is a neighborhood $U$ of $x$ such that $f(U\setminus\{x\})\subset V$. Define $g:X\to Y$ by $g(x)=y$. Then the claim is that the map defined by $g(x)=y$ is continuous.
To verify the claim, take an open set $V$ in $Y$. Observe that $g(x)\in V$ if and only if there is a neighborhood $U$ of $x$ such that $f(U\setminus\{x\})\subset V$. This implies $U\subset g^{-1}(V)$. Hence,  $g^{-1}(V)$ is open.
