Let X, Y and Z metric spaces, and $f:X \to Y$ and $g:f(X) \to Z$ continuous functions (where $f(X)$ is a subspace of Y). Need to show that $h(x)=g(f(x))$ is also continuous.
To prove it, I used the proposition that says that, when $f:X \to Y$ is a continuous function between two metric spaces, a sequence $\{x^n\} \to x$, then $f(x^n) \to f(x)$.
So then, $h(x^n)=g(f(x^n)) \to h(x)=g(f(x))$ Thus, $h$ is continuous $\square $.
However, the solutions I have seen on the internet uses the concept that the preimage of open sets are open when $f$ is continuous. These are much longer proofs, so I'm suspecting that my proof is incorrect.