TITLE: If $\lim_{n\to\infty} x_n =0$, then $\{f(x_n)\}$ is Cauchy?
QUESTION [6 upvotes]: For each positive integer $n$, let $x_n$ be a real number in $\left(0,\frac{1}{n}\right)$. Is the following true?

If $f$ is a continuous real-valued function defined on $(0,1)$, then $\{f(x_n)\}_{n=1}^\infty$ is a Cauchy sequence.

I can't see why this is wrong. My quick thought was that, if $x_n$ is Cauchy and $f$ is continuous, then $f(x_n)$ is Cauchy as well. I am very sure this is true for compact domain. Is it something going wrong with $x=0$? Could someone give a counterexample?

REPLY [2 votes]: This would be true if $f$ is uniformly continuous (basically, a function that maps Cauchy sequences into Cauchy sequences).
You're right to be sure if the domain is compact, because a continuous real function on a compact is uniformly continuous.
Note that $(x_n)$ converges to $0$ by the squeeze theorem, so it is Cauchy. Now you just need a function that's not uniformly continuous on $(0,1)$ and one that has infinite limit at $0$ is good enough. Another example is $f(x)=\sin(1/x)$ and $x_n=1/(2n)$, because
$$
\lim_{n\to\infty}\sin(2n)
$$
does not exist (not very easy to show, though, but I'm sure you can find it on the site).