Continuity on a neighbourhood of a point If a function $f$ is continuous at $x$, then there exists a neighbourhood of $x$, on which $f$ is continuous. Is it true of false?
 A: False. Let $f:\Bbb R\to \Bbb R$ be the function $$f(x)=\begin{cases}
x &\text{, if } x\in\Bbb Q\\
0 &\text{, else}\\
\end{cases}$$
It is continuous at $0$, but not continuous anywhere else (which is easy to prove). Now, if $U$ is a neighborhood of $0$ such that $f|_U:U\to\Bbb R$ is continuous, then $f:\Bbb R\to\Bbb R$ would be continuous at every $y\in\text{int}(U).$
Note that the phrasing $f$ is continuous on the neighborhood $U$ can mean "$f$ is continuous at each $y\in U$" but it can also mean "the restriction $f|_U$ is continuous". However, if there is a nbh satisfying the first, then there is also a nbh satisfying the second interpretation, and vice versa.
A: Although it seems a likely possibility, it is false. There are some crazy functions you can come up with to show this. One example is
$$
f(x) =
\begin{cases}
x^2 & x \in \mathbb{Q}\\
-x^2 & x \notin \mathbb{Q}
\end{cases}
$$
You can see that $f$ is continuous at $0$ since $\lim_{x \to 0}f(x) = 0$ (which you can rigorously prove using $\epsilon$-$\delta$) and $f(0) = 0$. But it is not continuous anywhere else. So there is no neighbourhood around $0$ where $f$ is continuous even though $f$ is continuous at $0$.
You can even show that $f$ is differentiable at $0$ since $|f(x)| \leq x^2$. So even differentiability at a point (which is a stronger criteria than continuity) does not guarantee that the function is continuous in a neighbourhood around that point.
