[proofplan]
The proof has two parts. The characteristic property — $g: X/{\sim} \to Z$ is continuous if and only if $g \circ \pi$ is continuous — follows from the definition of the quotient topology: $V \subset X/{\sim}$ is open if and only if $\pi^{-1}(V)$ is open in $X$. The forward direction is the general fact that compositions of continuous maps are continuous. The reverse direction uses the quotient condition to convert openness of preimages under $g \circ \pi$ into openness of preimages under $g$. For the "consequently" statement, we construct the induced map $\bar{f}$ using the compatibility condition and apply the characteristic property.
[/proofplan]
[step:Prove the forward direction: continuity of $g$ implies continuity of $g \circ \pi$]
Suppose $g: X/{\sim} \to Z$ is continuous. Since $\pi: X \to X/{\sim}$ is continuous (by definition of the quotient topology, the preimage under $\pi$ of every open set in $X/{\sim}$ is open in $X$), the composition $g \circ \pi: X \to Z$ is continuous as a composition of continuous maps: for any open $W \subset Z$,
\begin{align*}
(g \circ \pi)^{-1}(W) = \pi^{-1}(g^{-1}(W)),
\end{align*}
and $g^{-1}(W)$ is open in $X/{\sim}$ by continuity of $g$, so $\pi^{-1}(g^{-1}(W))$ is open in $X$ by continuity of $\pi$.
[/step]
[step:Prove the reverse direction using the defining property of the quotient topology]
Suppose $g \circ \pi: X \to Z$ is continuous. Let $W \subset Z$ be open. We verify that $g^{-1}(W)$ is open in $X/{\sim}$.
By the definition of the quotient topology, a subset $V \subset X/{\sim}$ is open if and only if $\pi^{-1}(V)$ is open in $X$. Applying this characterisation with $V = g^{-1}(W)$, we need to check that $\pi^{-1}(g^{-1}(W))$ is open in $X$. The preimage identity gives
\begin{align*}
\pi^{-1}(g^{-1}(W)) = (g \circ \pi)^{-1}(W),
\end{align*}
and $(g \circ \pi)^{-1}(W)$ is open in $X$ by the assumed continuity of $g \circ \pi$. Therefore $g^{-1}(W)$ is open in $X/{\sim}$. Since $W$ was an arbitrary open set in $Z$, the map $g$ is continuous.
[guided]
This is the substantive direction, and it is where the quotient topology does the work. The quotient topology on $X/{\sim}$ is the finest topology making $\pi$ continuous — equivalently, $V \subset X/{\sim}$ is open if and only if $\pi^{-1}(V)$ is open in $X$. This characterisation provides both the "only if" direction (continuity of $\pi$) and the "if" direction (the reverse implication that ordinary continuous maps do not satisfy).
To test whether $g^{-1}(W)$ is open, we apply the "if" direction: compute $\pi^{-1}(g^{-1}(W)) = (g \circ \pi)^{-1}(W)$ and check that it is open in $X$. Continuity of $g \circ \pi$ provides exactly this.
Why does this argument fail if $\pi$ is merely continuous rather than a quotient map? For an ordinary continuous map, knowing that $\pi^{-1}(V)$ is open does not allow us to conclude that $V$ is open — we have only the forward implication. The quotient map hypothesis provides the reverse implication, which is the engine of the entire universal property.
[/guided]
[/step]
[step:Construct the induced map $\bar{f}$ and verify its continuity via the characteristic property]
Suppose $f: X \to Z$ is continuous and $f(x) = f(y)$ whenever $x \sim y$. Define
\begin{align*}
\bar{f}: X/{\sim} &\to Z \\
[x] &\mapsto f(x)
\end{align*}
where $[x] = \pi(x)$ denotes the equivalence class of $x$. This map is well-defined: if $[x] = [x']$, then $x \sim x'$, so $f(x) = f(x')$ by hypothesis, and $\bar{f}([x]) = \bar{f}([x'])$.
By construction, $\bar{f} \circ \pi = f$: for every $x \in X$, $\bar{f}(\pi(x)) = \bar{f}([x]) = f(x)$. Since $f$ is continuous and $\bar{f} \circ \pi = f$, the composition $\bar{f} \circ \pi$ is continuous. By the characteristic property established above (reverse direction), $\bar{f}$ is continuous.
For uniqueness: suppose $h: X/{\sim} \to Z$ also satisfies $h \circ \pi = f$. Since $\pi$ is surjective, every element of $X/{\sim}$ is of the form $\pi(x)$ for some $x \in X$. For any such element,
\begin{align*}
h(\pi(x)) = f(x) = \bar{f}(\pi(x)),
\end{align*}
so $h = \bar{f}$.
[guided]
The "consequently" statement packages the characteristic property into the language of factorisation. The situation is summarised by the commutative diagram: $f$ factors through $\pi$ as $f = \bar{f} \circ \pi$, and the quotient topology is precisely the topology that makes this factorisation work.
The well-definedness of $\bar{f}$ is a set-theoretic fact: the condition $f(x) = f(y)$ whenever $x \sim y$ ensures that $f$ is constant on each equivalence class, so assigning $\bar{f}([x]) := f(x)$ depends only on the class $[x]$, not on the representative $x$.
The continuity of $\bar{f}$ then follows from the characteristic property in one line: $\bar{f} \circ \pi = f$ is continuous, therefore $\bar{f}$ is continuous. This is the paradigmatic application of the universal property — verifying continuity of a map out of a quotient by checking continuity of the composition with $\pi$.
Uniqueness uses surjectivity of $\pi$: every point of $X/{\sim}$ has at least one preimage, so the values of any function on $X/{\sim}$ are completely determined by its composition with $\pi$.
[/guided]
[/step]