I have always thought this result as a generalised version of the sequential criterion of continuity. Surely, $ \bar{A} $ contains all the convergent sequences from $ A $, and the result says that the functional images of those sequences is also convergent in $ f(A) $. However, when I am trying to prove this in Real Analysis, I am not able to complete the sufficient part. Following is my incomplete attempt:
Theorem:$ f:\mathbb{R}\to\mathbb{R} $ is continuous on $ \mathbb{R} $if$ \forall A\subset \mathbb{R} $, $ f(\bar{A})\subset \overline{f(A)} $.
Incomplete proof: Fix $ x\in\mathbb{R} $ arbitrary. Let the sequence $ \{x_{n}\} $ converge to $ x $. We will show $ f(x_{n})\to f(x) $.
Call the set $$ A=\{x_{n}:n\in\mathbb{N}\}. $$ Then $ x\in\bar{A} $. If $ A $ is finite, then $ \{x_{n}\} $ is an eventually constant sequence, thus so is $ \{f(x_{n})\} $, converging to $ f(x) $; trivially proving our claim.
Now, consider the case when $ A $ is infinite. By the hypothesis, $ f(\bar{A})\subset \overline{f(A)} $. Hence $ f(x)\in\overline{f(A)} $. Therefore, there exists a subsequence $ \{f(x_{p})\} $ of $ \{f(x_{n})\} $ converging to $ f(x) $. $ \blacksquare $
I am not able to conclude that the entire sequence $ f(x_{n})\to f(x) $.
Does this approach actually take you to the result? Or is there any fundamental misunderstanding in my interpretation of the result?