The problem
Let $X$ be an infinite set with the cofinite (finite complement) topology and let $Y$ be a Hausdorff space. Characterize the continuous functions from $X$ to $Y$.
What I have so far
For a function $f:X \rightarrow Y$ to be continuous, we have that
$f$ is continuous $\iff$ for any open set $U$ of $Y$, $f^{-1}(U)$ is open in $X$,
or, equivalently:
$f$ is continuous $\iff$ for any closed set $B$ of $Y$, $f^{-1}(B)$ is closed in $X$.
The closed sets of $X$ are all the finite subsets of $X$ or all of $X$.
Since every finite point set $W$ in a Hausdorff space is closed, we must have that $f^{-1}(W)$ is either a finite subset of $X$ or all of $X$.
But what about the infinite closed subsets of $Y$? I don't really know where to go from here. Am I on the right track here? Should I be looking at the closed sets at all?
Any help appreciated!