Let $q:X\to Y$ be a surjective map, where $(X,\tau_X)$ is a topological space. The quotient topology $\tau_q$ on $Y$ is given as $U\in \tau_q$ iff $q^{-1}(U)\in \tau_X$.
Suppose that there is another topology $\tau_d$ on $Y$ such that for any topological space $Z$ is holds that $f:Y\to Z$ is continuous iff $(f\circ q):X\to Z$ is continuous. I should prove that then $\tau_d = \tau_q$.
My idea is to consider $f_1 = \operatorname{Id}_Y:Y_d\to Y_q$ and $f_2 = \operatorname{Id}_Y:Y_q\to Y_d$ to use the characteristic property. Then I have that since $q:X\to Y_q$ is a quotient map, it is continuous hence $f_2$ is continuous. Here $Y_q = (Y,\tau_q) $ and $Y_d = (Y,\tau_d)$.
But I don't have an idea how to prove that $f_1$ is continuous since I don't know that $q:X\to Y_d$ is continuous. To prove the last fact I consider $f_3 = \operatorname{Id}_Y:Y_d\to Y_d$ which is continuous so is $q = (f_3\circ q):X\to Y_d$. Hence, $q:X\to Y_d$ is continuous so is $f_1$.
Could you please help me to realize if my proof is correct?