Consider the following variant on the topologist's sine curve.
!enter image description here
This space $X$ consists of the graph of $y = \sin(\pi/x)$ for $0
However, there exists a continuous surjection $f\colon [0,2)\to X$. Specifically, $f(0) = (0,0)$ and $f(1) = (1,0)$, with $f(t)$ following along the bottom curve for $0\leq t\leq 1$. For $t>1$, the function follows along the sine curve, i.e. $$ f(t) \;=\; \left(2-t,\sin\left(\frac{\pi}{2-t}\right)\right)\qquad\text{for }t> 1\. $$