If f(x_n) converges whenever (x_n), then f is continuous.

This is the original question:

Let $$f: X\to Y$$ be a map between metric spaces. Prove that if $$(f(x_n))_{n=0}^\infty$$ converges in $$Y$$ whenever $$(x_n)_{n=0}^\infty$$ converges in $$X$$ then $$f$$ is continuous. [Note: it is not given that $$f(x_n) → f(x)$$ whenever $$x_n → x$$.]

I have spent quite a bit of time on this problem. I finally looked it up and have been reading the solution in the link below:

for every convergent sequence $x_n$, $f(x_n)$ also converges. Does this imply continuity of f?

I am confused by the solution given. I understand that they proved that $$f(x_n)$$ does not converge to $$f(x)$$, but this doesn't prove that $$f(x_n)$$ does not converge at all. If we want to use the contrapositive, shouldn't be have to show that if $$f$$ is discontinuous, then there is some sequence $$(x_n)$$ that converges in $$X$$ but $$f(x_n)$$ does not converge in $$Y$$. That is, we have to show that for some convergent sequence, there is some $$\varepsilon$$ such that for all $$n$$ greater than some $$N$$, $$f(x_n)>\varepsilon$$.

Any clarification or hints would be greatly appreciated.

• A convergent sequence in a metric space is a Cauchy sequence. But the sequence $f(x),f(x_1),f(x),f(x_2),...$ which was given in the accepted answer is clearly not Cauchy, because $d(f(x),f(x_n))\geq\epsilon$ for all $n$. So it doesn't converge at all.
– Mark
Aug 9, 2019 at 21:12

What I proved in that answer was that, if $$f$$ was discontinuous at some point $$x$$, then there is a sequence $$(x_n)_{n\in\mathbb N}$$ of elements of $$X$$ converging to $$x$$ such that the sequence $$\bigl(f(x_n)\bigr)_{n\in\mathbb N}$$ is not convergent. But we are assuming that no such sequence exists.
• That is correct, yes, but that was not the approach that I had in mind. What I thought was that my sequence has a subsequence which converges to $f(x)$ and another subsequence such that each of its terms is at a distance at least equal to $\varepsilon$ (for a fixed number $\varepsilon>0$) from $f(x)$. This later subsequence cannot possibly converge to $f(x)$. But when a sequence converges, each of its subsequences converges to the same limit. Aug 9, 2019 at 21:24