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
It seems that you're implying that if $h:X\to Y$ and $g:Y\to Z$ such that $h$ is continuous, then $g\circ h$ is continuous if and only if $g$ is continuous. This is simply not true (if I am misinterpreting what you say, then let me know).
Note that for any open set $U\subset Y$, $f^{-1}(U)=h^{-1}(g^{-1}(U))$. Now try using the fact that by the definition of the quotient topology, $g^{-1}(U)$ is open in $X/{\sim}$ if and only if $h^{-1}(g^{-1}(U))$ is open in $X$.