I read that a map $f:X \rightarrow Y$ is continuous, if for any open set $O \subseteq Y$, the preimage $f^{-1}(O)$ is open in $X$. Alternatively, if $O$ is closed in $Y$, the preimage is closed in $X$.
However, suppose that $Y$ is equipped with the discrete topology where all subsets of $Y$ are clopen. Is there an instance where a continuous function maps an open set in $Y$ to an open set in $X$, but does not do so for closed sets ?