for every convergent sequence $x_n$, $f(x_n)$ also converges. Does this imply continuity of f? 
Let $f\colon(X,d_X)\rightarrow(Y,d_Y)$ be a function between metric spaces such that for every convergent sequence $(x_n)_{n\in\mathbb{N}}$ in $X$ the sequence $(f(x_n))_{n\in\mathbb{N}}$ is convergent in $Y$. Does this impy continuity of $f$?

At first I thought that this does not imply the continuity of $f$, so I tried to think of a counterexample. I thought about it for a long time, but I couldn't find one. I found a few similar problems, but none helped me. Can someone help me please?
 A: Suppose that $f$ is discontinuous at some point $x$. Then,for some $\varepsilon>0$, if $n\in\mathbb N$, then there is a $x_n\in B\left(x,\frac1n\right)$ such that $d\bigl(f(x),f(x_n)\bigr)\geqslant\varepsilon$. Now consider the sequence$$x,x_1,x,x_2,x,x_3,\ldots$$It converges (to $x$). However, the sequence$$f(x),f(x_1),f(x),f(x_2),f(x),f(x_3),\ldots$$does not converge.
A: Assume $f$ is not continuous at $x \in X$. Then there must exist $\{x_n\} \rightarrow x$, and so $f(x_n)$ is convergent in $Y$, but $f(x_n) \nrightarrow f(x)$. Now if $x$ was an isolated point of $X$ then $x_n = x \forall n > N, N \in \Bbb N$ and it's obvious $f$ must be continuous at $x$ (think why).
Otherwise, if $\{x_n\}$ isn't that trivial, then we can consider the following sequence:
$$ y_{2n} = x, y_{2n+1} = x_n \implies y_n \rightarrow x $$
and, of course, $\{f(y_n)\}$ converges, too. 
But then $f(x) = \lim_{n \to \infty} f(y_{2n}) = \lim_{n \to \infty} f(y_{2n+1}) = \lim_{n \to \infty} f(x_n)$, 
and we know this is equivalent to $f$ being continuous at $x$ in metric spaces.
