$$f(x)=\begin{cases} 1 & \text{for } x=\frac{1}{n}, \; n\in\mathbb{Z}\\0 & \text{otherwise.}\end{cases}$$
I am asked to find the points of discontinuity on the interval $[-1,1]$.
I think I'm supposed to prove that the limit of the function at any given $x=\frac{n}{2}$ will be $0$, so the function is discontinuous at those points, but I don't know how to prove this.
$f$ is continuous on all intervals $\left(\frac{1}{n + 1}, \frac{1}{n}\right), n \gt 0$ and $\left(\frac{1}{n}, \frac{1}{n - 1}\right), n \lt 0$.
$f$ is discontinuous at all points $\frac{1}{n}, n \in \mathbb{Z}$ because $f(\frac{1}{n}) = 1 \neq 0 = \lim_{x \to \frac{1}{n}} f(x)$. These are all removable discontinuities.
The only other point of interest is $x = 0$. $f$ is discontinuous at $0$ because $\lim_{x \to 0} f(x)$ does not exist; this is an essential discontinuity. Sequences $\left(x_n\right)$ can be chosen where $x_n \to 0$ and $f(x_n) \to 0$ or $f(x_n) \to 1$ or $f(x_n)$ flips back and forth between $0$ and $1$. For example, $(x_n) = \frac{1}{n}$ has $f(x_n) \to 1$; $(x_n) = \frac{2}{2n + 1}$ has $f(x_n) \to 0$; and $(x_n) = \frac{2}{n}$ has $f(x_n)$ alternate between $0$ and $1$.