TITLE: If $f$ takes Cauchy sequence to Cauchy sequence then $f$ is continuous
QUESTION [8 upvotes]: If $f:X\to Y$ takes Cauchy sequence to Cauchy sequence then prove that $f$  is a continuous function.
Let $x_n$ be a  sequence in $X$ such that $x_n\to x\implies x_n$ is Cauchy $\implies f(x_n)$ is Cauchy but that does not guarantee that $f(x_n) \to f(x)$ .
So how is the above result true. Please help.

REPLY [16 votes]: If $(x_n) \rightarrow x$, make a new sequence $y_{2n} = x_n, y_{2n+1} = x$, so intersperse terms of the sequence with the limit. 

Show that $(y_n)$ is Cauchy. 
So the sequence $(f(y_n)) = f(x_0), f(x), f(x_1), f(x),\ldots$ is Cauchy by assumption.
From this show that $f(x_n) \rightarrow f(x)$.

For the last, there is a more general fact you might know: if a Cauchy sequence has a convergent subsequence (with limit $p$), the whole sequence converges to $p$ as well. But a direct proof is also easy enough.