Let $f:\mathbb{R}\mapsto \mathbb{R}$. The goal is to prove that $f$ is continuous if, and only if, for all $X\subset \mathbb{R}$, $f(\overline{X})\subset \overline{f(X)}$
Let $X\subset \mathbb{R}$, $y\in f(\overline{X})$ and let $a\in\overline{X}$ such that $f(a)=y$. Since $f$ is continuous in $\mathbb{R}$ and $a$ is a point in the closure, for all sequences $(x_n)_{n\in\mathbb{N}}\subset X$ which converge to $a$, implying that $f(x_n)\to f(a)$ in ${\overline{X}}$. Thus, $f(a)\in \overline{f(X)}$ because there exists a sequence $(f(x_n))_{n\in\mathbb{N}}\subset f(X)$ such that $f(x_n)\to f(a)$. The same argument follows for any subset $X$.
What is bugging me is the reciprocal.
Let $a\in \mathbb{R}$. To prove that $f$ is continuous at point $a$,it is sufficient to show that for every sequence $(x_n)_{n\in\mathbb{N}}$ that converges to $a$, $f(x_n)\to f(a)$. In other words, we must define a set $X$ such that $a\in \overline{X}$, from what follows that $f(a)\in \overline{f(X)}$ and, therefore, $\exists (f(y_n))_{n \in\mathbb{R}}\subset X$ such that $f(y_n)\to f(a)$. This strategy shows that a sequence exists, but I am having trouble to guarantee that $(f(x_n))$ converges to $a$.
Maybe there is an easier way.
EDIT: This post proves the part I was struggling with. It uses the same strategy pointed out by other answers here. The first part of my proof, alongside the suggested contradiction, concludes that the proposition is true, extending the result from 2021 post.