Proposition
Let $f:X\to Y$ be a real-valued function over $X\subseteq\mathbb{R}$. Then $f$ is continuous at $x_{0}\in X$ if and only if $f(x_{n})\to f(x_{0})$ whenever $x_{n}\in X$ converges to $x_{0}$.
Proof
We shall prove the implication $(\Rightarrow)$ first.
Let us suppose that $f:X\to Y$ is continuous at $x_{0}\in X$. Then for every $\varepsilon > 0$, there corresponds $\delta_{\varepsilon} > 0$ such that for every $x\in X$ one has that
\begin{align*}
|x - x_{0}| \leq \delta_{\varepsilon} \Rightarrow |f(x) - f(x_{0})| \leq \varepsilon
\end{align*}
Moreover, since $x_{n}\to x_{0}$, there corresponds $n_{\varepsilon}\in\mathbb{N}$ such that
\begin{align*}
n\geq n_{\varepsilon} \Rightarrow |x_{n} - x_{0}| \leq \delta_{\varepsilon}
\end{align*}
Gathering both results, we deduce that for every $\varepsilon > 0$, there corresponds $n_{\varepsilon}\in\mathbb{N}$ such that
\begin{align*}
n\geq n_{\varepsilon} \Rightarrow |x_{n} - x_{0}|\leq\delta_{\varepsilon} \Rightarrow |f(x_{n}) - f(x_{0})|\leq\varepsilon
\end{align*}
whence we get that $f(x_{n})\to f(x_{0})$, and we are done.
Let us prove the implication $(\Leftarrow)$ this time.
Let us assume that $x_{n}\in X$ converges to $x_{0}$ and $f$ is not continuous at $x_{0}$.
This means there exists an $\varepsilon > 0$ such that for every $\delta$ there corresponds a $x_{\delta}\in X$ satisfying
$$(|x_{\delta} - x_{0}| \leq \delta)\wedge(|f(x_{\delta}) - f(x_{0})| > \varepsilon).$$
In particular, if we take $\delta = 1/n$, there corresponds a $x_{n}\in X$ such that $|x_{n} - x_{0}| \leq 1/n$.
Taking the limit in the last expression, we conclude through the sandwich theorem that $x_{n}\to x_{0}$.
But $f(x_{n})\not\to f(x_{0})$ since $|f(x_{n}) - f(x_{0})| > \varepsilon > 0$, and we are done.
Hopefully this helps!