Let
$$f(x)= \begin{cases}0 & x \notin \mathbb{Q} \\ 1 & x=0 \\ 1 / x & x \in \mathbb{Q}\end{cases}$$
Let $a \in \mathbb{R}$. Prove that $f(x)$ converges as $x$ approaches $a$ if and only if $a \notin \mathbb{Q}$.

---

Only considering the converse case, so far I've written

$(\Leftarrow)$ Case 1: Let $a \notin \mathbb{Q}$, and let $x \in \mathbb{Q}$. It follows that $f(a) = 0$ and $x \neq a$; therefore there exists $\epsilon\_0$ so that
$$0<\epsilon\_0<|x-a|<\delta$$
Let $\epsilon\_0 = 1/\epsilon$ where $\epsilon > 0$. Then
$$0<\frac{1}{\epsilon}<|x-a|<\delta$$
In particular, $x > 1/\epsilon$ and so
$$ \begin{align} \frac{1}{x} &< \epsilon \\ \left| \frac{1}{x} - 0 \right| &< \epsilon \\ \left| f(x) - f(a) \right| &< \epsilon \end{align}$$
whenever $x \in (a-\delta,a+\delta)$.

Case 2: Let $x \notin \mathbb{Q}$. Then for $\epsilon > 0$
$$ \begin{align} \left| f(x) - f(a) \right| &< \epsilon \\ \left| 0 - 0 \right| &< \epsilon \\ 0 &< \epsilon \end{align}$$
whenever $x \in (a-\delta,a+\delta)$, which is true since $\epsilon > 0$.

Therefore if $a \notin \mathbb{Q}$, then $f(x)$ converges as $x$ approaches $a$.

---

The working for Case 1 is pretty much all I could think of and it looks completely wrong to me so I'd appreciate some thoughts, thank you!