I am trying to prove this theorem from Analysis I by Tao.
Proposition 9.3.9. Let $X$ be a subset of $\mathbb{R}$, let $f : X → R$ be a function, let $E$ be a subset of $X$, let $x_0$ be an adherent point of $E$, and let $L$ be a real number. Then the following two statements are logically equivalent:
(a) $f$ converges to $L$ at $x_0$ in $E$. (i.e $\forall \varepsilon > 0 \exists \delta > 0 s.t \forall x \in E $ and $|x_{0}-x|\leq \delta , |f(x)-L|\leq \varepsilon$)
(b) For every sequence $(a_{n})_{n=0}^{\infty}$ which consists entirely of elements of $E$ and converges to $x_0$, the sequence $(f(a_{n}))_{n=0}^{\infty}$ converges to $L$.
I have (I think) been able to assume (a) and show that (b) follows. Let $(a_n)_{n=0}^{\infty}$ be a sequence converging to $L$.
Let $\varepsilon > 0$, and then I want to find an $N \in \mathbb{N}$ such that for every $n \geq N$
$$ |f(a_n) - L| < \varepsilon. $$
From the assumption in part (a) there must exist $\delta >0$ such that
$$ |a_n - x_0| < \delta \implies |f(a_n) - L| < \varepsilon $$
so if I can find $N \geq 1$ such that for all $n \geq N$ it is the case that $|a_n - x_0| < \delta$ then this direction is proven. By the fact that $a_n$ converges to $L$ for all $\varepsilon > 0$ (and thus also $\varepsilon = \delta$) this $N$ exists.
I am stuck on proving the other direction, assume (b) and attempt to prove (a).
Let $\varepsilon > 0$, and $\delta > 0$ (to be restricted later) and then $x \in E$ such that $|x - x_0| < \delta$.
Then I thought that I could use the fact that $x_0$ is an adherance point of $E$ to construct a sequence $(a_n)_{n=0}^{\infty}$. A very naïve guess is that because for every $\varepsilon > 0$ there exists a $y \in E$ such that $|y - x_0| < \varepsilon$, I could define the sequence $(a_n)_{n=0}^{\infty}$ such that $a_0$ is just the $x$ in question. Then let $a_1$ be such that $|a_1 - x_0| < \frac{\delta}{2}$, $a_2$ such that $|a_2 - x_0| < \frac{\delta}{3}$ and so on. Clearly this sequence converges to $x_0$, and therefore $(f(a_n))_{n=0}^{\infty}$ converges to $L$, by the assumption of (a).
However, in trying to exploit the fact that $(f(a_n))_{n=0}^{\infty}$ converges to $0$, I got a bit stuck because there are no guarantees that for a given $\varepsilon$, $f(a_0)$ is $\varepsilon$-close to zero (as the sequence must just be eventually $\varepsilon$-close).
I tried to think about what kind of sequence would be ideal - one which contains all the points in $E$ such that $|x - x_0| < \delta$ and converges to $L$, ideally (but I don't think that's possible as $E$ is not necessarily countable).
Sadly I'm kind of stuck here. Any hints/direction would be much appreciated. I think this should not be a very difficult proof and that I'm going about it the wrong way.
I thought maybe I should try to prove by contrapositive (but I have also seen advice not to do this as it is much easier to mistakes this way).
(b) implies (a) is usually proved by contrapositive. If (a) does not hold, then there exists some $\varepsilon>0$ such that for every $\delta>0$ there exists some $x\in E$ for which $|x-x_0|<\delta$ but $|f(x)-L)|\geq\varepsilon$. In particular, for every $n$ there exists some $x_n\in E$ such that $|x_n-x_0|<\frac{1}{n}$ but $|f(x_n)-L|\geq\varepsilon$. Therefore there exists a sequence $x_n\in E$ such that $x_n\to x_0$ as $n\to\infty$ but $f(x_n)$ does not converge to $L$.