TITLE: If $f$ and $g$ are continuous, prove $f\circ g$ is continuous.
QUESTION [6 upvotes]: Suppose that $(X,T)$, $(Y,U)$ and $(Z,V)$ are three topological spaces and that
  $g\colon X\to Y$ and $h\colon Y \to  Z$ are continuous. Prove that $h\circ g\colon X \to Z$ is a continuous function between $(X,T)$ and $(Z,V)$.

This is a question in a past paper I am attempting however I do not have any solutions and need to check if my attempt is correct:
Let $A\subseteq Z$ be open, then
$$g^{-1}(h^{-1}(A))=(h\circ g)^{-1}A$$
is open in $X$, hence $h\circ g$ is continuous.
I think I am missing out some steps somewhere?

REPLY [2 votes]: your answer is not complete you need to say that
since $A$ is open and h is continuous then $h^{-1}(A)$ is open 
also since $g$ is continuous and $h^{-1}(A)$ is open then $g^{-1}(h^{-1}(A))$ is open
so $h\circ g$ is continuous