Prove that $Y$ and $Z$ are homeomorphic. Let $q:X \to Y, g:X \to Z$ be two quotient maps so that the fibres of $q$ and $g$ are the same: for any $y \in Y$ there is $z \in Z$ so that
$q^{-1}(y)=g^{-1}(z)$. Prove that $Y$ and $Z$ are homeomorphic.
By the universal property of $q$. The map $g:X \to Z$ gives rise to a continuous map $\overline{g}: Y \to Z$ so that $g=\overline{g} \circ q$. What to do next?
 A: We also have a continuous map $\overline q \colon Z \to Y$ such that $\overline q \circ g = q$; so $$\overline q \circ \overline g \circ q = \overline q \circ g = q$$ and that means $\overline q \circ \overline g$ and $\operatorname{id}_Y$ agree on each element of the image of $q$. But $q$ is surjective… so $\overline q \circ \overline g = \operatorname{id}_Y$. Similarly $\overline g \circ \overline q = \operatorname{id}_Z$.
A: Let $X/q$ and $X/g$ be the quotient spaces of the equivalence relations on $X$ generated by $q$ and $g$ respectively, with corresponding quotient maps $\pi_q: X \to X/q, \ \pi_g: X \to X/g $. Then $X/q$ and $X/g$ are the fibres of $q$ and $g$, respectively.
At first, it looks like the given condition is only telling us that $X/q \subseteq X/g$, so we need to justify the statement that $q$ and $g$ have the same fibres. The following claim implies that the reverse inclusion holds as well.
Claim: For all $x \in X$, we have that $\pi_q(x) = \pi_g(x)$.
Proof: Suppose that $x \in X$. Then $\pi_q(x) = q^{-1}(\{q(x)\})$ and $\pi_g(x) = g^{-1}(\{g(x)\})$. We know that $q^{-1}(\{q(x)\}) = g^{-1}(\{z\})$ for some $z \in Z$, but since $x \in \pi_q(x)$, we have that $g(x) = z$. Thus, $g^{-1}(\{z\}) = g^{-1}(\{g(x)\})$, and so $\pi_q(x) = \pi_g(x)$.
From the claim we can conclude that $X/q = X/g$ since the maps $\pi_q$ and $\pi_g$ are surjective. Hence, $\pi_q = \pi_g$, and thus $X / q \simeq X/g$, so we can finish by noting that $Y \simeq X/q$ and $Z \simeq X/g$. Alternatively, we could use the fact that $X/q = X/g$ to conclude that $q(x) = q(x')$ if and only if $g(x) = g(x')$ for all $x,x' \in X$, invoke the universal properties of $q$ and $g$, and proceed as in azif00's answer.
