Cauchy sequences , continuity and completeness We have been taught that if $X$ and $\mathbb{R}$ are two complete metric spaces then $f:X \to \mathbb{R}$ is a continuous function iff it carries cauchy sequences to cauchy sequences.

However let us assume that $X$ is not complete then does there exist a function $f$ such that it maps every cauchy sequence to cauchy sequence but it is not continuous.

I think the answer will be true if we have $\mathbb{R}$ as our range.
Proof:If it maps every convergent sequence to convergent sequence then $f$ is continuous.
Let $\{x_n\}$ be a convergent sequence in $X$ then $\{x_n\}$ is cauchy and $\{f(x_n)\}$ is cauchy then $\{f(x_n)\}$ is convergent in $\mathbb{R}$.So $f$ is continuous.
I am not sure if this holds true when the range is not $\mathbb{R}$ or nor any complete metric space.

If $X$ is complete,$Y$ is incomplete and let $f:X->Y$ be any function that carries cauchy sequences to cauchy sequences then is $f$ continuous?

My answer is no. A possible contradictory example that I could think of is $f:[0,1] \to (0,1]$ where $f(0)=1$ and $f(x)=x$ when $x \ne 0$. This function maps all cauchy sequences to cauchy but it is discontinuous at $0$
 A: Completeness is not needed here:

Proposition. If $X$, $Y$ are any metric spaces and $f \colon X \to Y$ maps Cauchy-sequences to Cauchy-sequences, then $f$ is continuous.

Let $x_n \to x$ in $X$. Then the sequence $(\xi_n)$ given by
$$ \xi_n := \begin{cases} x & n \text{ odd} \\ x_k & n = 2k \text{ even} \end{cases} $$
is Cauchy. Therefore $\eta_n := f(\xi_n)$ is Cauchy, too. As $\eta_n$ is given by
$$ \eta_n = \begin{cases} f(x) & n \text{ odd} \\ f(x_k) & n = 2k \text{ even} \end{cases} $$
we must have $f(x_n) \to f(x)$: For if $\epsilon > 0$ is given, there is $N$ such that
$|\eta_n - \eta_m| < \epsilon$ for $n,m \ge N$. Let $K$ such that $2K \ge N$, and $k \ge K$ we have
$$ |f(x_k) - f(x)| = |\eta_{2k} - \eta_{2k+1}| < \epsilon. $$
Hence, $f$ is continuous.

One can show, that in addition, every uniformly continuous map maps Cauchy-sequences to Cauchy-sequences, but both reversions are not true: There are maps to map Cauchy-sequences to Cauchy-sequences that aren't uniformly continuous (the example that comes to my mind being $\mathbf R \to \mathbf R$, $x \mapsto x^2$) and maps that are continuous, but don't map Cauchy-sequences to Cauchy-sequences to Cauchy-sequences (my favorite example here being $(0,\infty) \to \mathbf R$, $x \mapsto x^{-1}$; the Cauchy-sequence $(n^{-1})$ is mapped to $(n)$). Note that in the latter case, $X$ must not be complete: If $X$ is complete, continuity suffices as Cauchy-sequences are the convergent in $X$. Hence, its the other way round as you asked in your question: Mapping Cauchy-sequences to Cauchy-sequences is the stronger property in comparison to continuity and both agree if $X$ is complete (I think one can prove "iff" here).
