Let $X,Y,Z$ be topological spaces. Let $p:X\rightarrow Y$ be a continuous surjection. Let $f:Y\rightarrow Z$ be continuous if and only if $f\circ p:X\rightarrow Z$ is continuous.
I want to prove that this makes $p$ a quotient map.
My thoughts:
Since $p$ is a continuous surjection, all I need is for $p$ to also be open.
If I can show that $p^{-1}$ exists and is continuous, then $p$ must be open, and therefore a quotient map. Since $p$ is surjective, I know that $p$ at least has a right inverse, so some function $g$ exists such that $p\circ g = Id_Y$.
I don't know how to proceed, however. Am I on the right track?
This follows from univeral property arguments. If an object satisfies the same universal property as a quotient, product, coproduct etc. then it is that quotient, product, coproduct etc. You can give a much shorter proof of this without universal property arguments, but if you become familiar with such arguments, then problems like this can be solved in a mechanical way without doing much thinking.
Lemma: Let $\pi: X \rightarrow S$ be a quotient map. That is, $\pi$ is surjective, and $U$ is open in $S$ if and only if $\pi^{-1}U$ is open in $X$. Then for any space $Z$, and any continuous map $g: X \rightarrow Z$ such that $\pi(x_1) = \pi(x_2)$ implies $g(x_1) = g(x_2)$, there is a unique continuous map $\bar{g}: S \rightarrow Z$ such that $g = \bar{g} \circ \pi$.
Proof: If we forget continuity and just worry about $\pi$ and $f$ as maps of sets, it's clear that there is a unique function $\bar{g}: S \rightarrow Z$ such that $g = \bar{g} \circ \pi$, namely for any $s \in S$, we find an $x \in X$ such that $\pi(x) = s$, and then define $\bar{g}(s) = g(x)$. This is a well defined function which doesn't depend on the choice of $x$. We just need to show that $\overline{g}$ is continuous.
If $V \subseteq Z$ is open, we want to show that $\bar{g}^{-1}V$ is open in $S$. This is true if and only if $\pi^{-1}\bar{g}^{-1}V$ is open in $X$. But $\pi^{-1}\bar{g}^{-1}V = (\bar{g} \circ \pi)^{-1}V = g^{-1}V$, and $g$ is continuous, so it is open in $X$. $\blacksquare$
Now let $p: X \rightarrow Y$ be your surjective continuous map. We are supposing that for any continuous map $f: X \rightarrow Z$ such that $p(x_1) = p(x_2)$, there is a unique continuous map $\bar{f}: Y \rightarrow Z$ such that $\bar{f} \circ p = f$, and we want to show that $Y$ has the quotient topology.
Temporarily forget the existing topology on the set $Y$, and give this set the quotient topology with respect to the surjective function $p: X \rightarrow Y$. Denote the set $Y$, together with the quotient topology, by the letter $S$. Then $p: X \rightarrow S$ is a quotient map. What you want to show then is that $S = Y$ (already they are equal as sets, but you want to show that they are the same topological space). This amounts to showing that the identity function $S \rightarrow Y$ is a homeomorphism.
Since the quotient map $p: X \rightarrow S$ is by definition continuous, your hypothesis on $Y$ tells you that there must be a unique continuous map $j: Y \rightarrow S$ such that $p = j \circ p$ as maps $X \rightarrow S$. As a map of sets, $j$ is obviously the identity map. Thus the identity map $Y \rightarrow S$ is continuous.
On the other hand, the lemma tells you that $S$ satisfies the same property as $Y$: since $p: X \rightarrow Y$ is continuous, there must be a unique continuous map $i: S \rightarrow Y$ such that $p = p \circ i$ as maps $X \rightarrow Y$. As a map of sets, $i$ is obviously the identity map. Thus the identity map $S \rightarrow Y$ is continuous.
Since the identity function $S \rightarrow Y$ and its inverse are both continuous, this function is a homeomorphism, meaning $Y$ has the same topology as $S$, so $p: X \rightarrow Y$ is actually a quotient map.