Proof (composition preserves continuity)

Let $V$ be a neighbourhood of $g\circ f(x_0)$. Note that $$ \begin{align*} (g\circ f)\inv(V) = f\inv(g\inv(V)). \end{align*} $$

Since $g$ is continuous, $g\inv(V)$ is a neighbourhood of $f(x_0)$.

Then since $f$ is continuous, $f\inv(g\inv(V))$ is a neighbourhood of $x_0$.