Solution (source code)

= Solution

Assume inverse images of <open set>[open sets] are open. If $x_n\to a$ and $V$ is any open neighbourhood of $f(a)$, then $f^{-1}(V)$ is an open neighbourhood of $a$. By the definition of <convergence in a metric space>, $x_n\in f^{-1}(V)$ eventually, and hence $f(x_n)\in V$ eventually. Thus $f(x_n)\to f(a)$.