EDIT: My post is about the spaces fulfilling the condition: If $x_n$ converges to $x$, then $f(x_n)$ converges to $f(x)$.
It seems, the you were asking about weaker condition: If $x_n$ is convergent, then $f(x_n)$ is convergent (as pointed out by Nate Eldredge).
I'll leave my answer, since it might be interesting for you anyway. (Any counterexample to the stronger condition is a counterexample to the weaker condition as well.)
This is true if $X$ is a sequential space. This paper gives a good introduction into the topic. Example 3.6 in this paper is an example of space that is not sequential. You can also find some useful information in this blog and its continuation. This question is also related to sequential spaces.
Your claim is true for arbitrary topological spaces if you replace sequences with nets.
There are many examples of spaces that are not sequential. Any non-discrete topological space with no non-trivial convergent sequences will do, such as cocountable topology on an uncountable set (see wikipedia article) or Stone-Čech compactification of countable discrete space (see this question).
For a space $X$ where every convergent sequence is eventually constant, you can take a discrete topological space $Y$ having at least 2 points. Then every function $f:X\to Y$ preserves convergence of sequences. But all such functions are continuous only if $X$ is discrete.
I will give the following counterexample (again, in this space all convergent sequences are eventually constant):

In this picture every arrow represents a convergent sequence (i.e. a topological space on a countable set, that has unique accumulation point and the neighborhoods of this point are precisely the cofinite sets; e.g. $\{0\}\cup\{1/n; n\in\mathbb N\}$ as the subspace of real line has this topology). If we make a quotient of a topological sum of such spaces (in the way given in this picture), we get a sequential space. The picture shows a subspace of a sequential space that is not sequential. (There is only one point that is not isolated. No sequence of isolated points converges to this point. Showing this is basically an exercise in working with quotient topology.)