Solution (source code)

= Solution

Suppose $f(X)=U\cup V$ were a separation into two disjoint nonempty relatively <open sets>. <Continuity> makes $f^{-1}(U)$ and $f^{-1}(V)$ open in $X$, and they are disjoint, nonempty and cover $X$. This contradicts <connectedness> of $X$. Hence $\boxed{f(X)\text{ is connected}}$.