Finding function with discontinuity at $x = 0$ I am trying to find a function $f: \mathbb{R} \to \mathbb{R}$ that is continuous everywhere except $x = 0$. The only example that comes to mind is $f(x) = \frac{1}{x}$, but this isn't even a candidate, I think, because it is undefined at $x = 0$, so I can't really talk about &quot;continuity&quot; at $x = 0$. Another option is a function with a jump discontinuity at $x = 0$: something like $f(x) = x$ for $x \neq 0$ and $f(x) = 1$ when $x = 0$. Then I can take a sequence of points, either from above or below, converging to $0$, but not to $f(0)$.
Is this incorrect? Is there a more elegant solution than this?
The &quot;jump discontinuity&quot; approach is very common.
$$ f(x) = \frac{1}{x}$$
is indeed not defined at $0$, so it is not an example of the desired function.
The canonical example is called a $\delta$ function, which there are two (Dirac and Kronecker). In a set-theoretic application, the Kronkecker delta function is also called an indicator function.
Take
$$
\delta_a(x) =  \begin{cases}1 &amp; x = a \\ 0 &amp;  x \neq a\end{cases}
$$
In topology, the &quot;topologist's sine curve&quot; can be extended onto all of $\mathbb R$ by
$$
T(x) = \begin{cases} \sin\left( \frac \pi x\right) &amp; x \neq 0 \\ 0 &amp; x = 0
\end{cases}
$$
$T$ has some interesting topological properties when restricted to $(0,1]$.
What about
$$f(x)=\begin{cases}\frac{\sin x}x,&amp;x\neq0\\{}\\-4,&amp;x=0\end{cases}\;\;\;?$$