Let $X,Y$ be topological spaces, $\sim$ an equivalence relation on $X$ and $X/{\sim}$ the quotient space equipped with the quotient topology. Moreover, let $f:X\to Y$ be a map such that $f(x) = f(y)$ if $x \sim y$. Show that the map $g:X /{\sim} \to Y, [x] \to f(x)$ is continuous if and only if $f$ is continuous.
I started with defining a map $h:X \to X /{\sim}$, $x \to [x]$ $g(h(x)) = f(x)$. Then
$$ f^{-1}(U) = \{x \in X :f(x) \in U \} = \{x \in X : g(h(x)) \in U \} = (g \circ h)^{-1}(U) $$
Now $h$ continuous, so we have the following equivalence.
$f$ also continuous $\Leftrightarrow$ $g \circ h$ continuous $\Leftrightarrow$ g continuous