TITLE: Counterexample: Continuous, but not uniformly continuous functions do not preserve Cauchy Sequences
QUESTION [15 upvotes]: I want to prove this:
There exists a continuous function $f:\mathbb{Q}\to\mathbb{Q}$, but not uniformly continuous, and a Cauchy sequence $\{x_n\}_{n\in\mathbb{N}}$ of rational numbers such that $\{f(x_n)\}_{n\in\mathbb{N}}$ is not a Cauchy sequence.
More particular:
Does there exist a Cauchy sequence $\{x_n\}_{n\in\mathbb{N}}$ of rational numbers such that $\{x_n^2\}$ is not Cauchy?
I think that would be weird, and the counterexample should be with some function that is continuous in $\mathbb{Q}$ but not in $\mathbb{R}$. Am I right? Which would be some example of that?

REPLY [4 votes]: Another simple example is given by $f(x)=\frac1{x^2-2}$.