As some background on notation, I am going to write down a theorem I've already proved.
Let $X$ be a set with an equivalence relation $\sim$. Let $\phi: X \to Y$ be a map of sets such that $x_1 \sim x_2$ implies $\phi(x_1) = \phi (x_2)$, and $\pi: X \to X/\sim$ the canonical quotient map sending $x \mapsto \overline{x}$, where $\overline{x}$ is the coset containing $x$. Then there exists a uniquely defined map $\tilde{\phi}: X/\sim \to Y$ such that $\phi = \tilde{\phi} \circ \pi$.
The map is defined as follows. Given $y \in X/\sim$, the map $\pi$ is surjective, so there exists $x \in X$ such that $\pi(x) = y$. Then define $\tilde{\phi}(y) = \phi(x)$. I proved that this map is well-defined, unique, and works as intended.
The result I am trying to prove is:
Prove that $\tilde{\phi}$ is surjective if and only if $\phi$ is surjective.
Here is my attempt.
Suppose that $\phi$ is surjective, so given $y \in Y$, there exists $x \in X$ such that $\phi(x) = y$. Then $$ y = \phi(x) = (\tilde{\phi} \circ \pi)(x) = \tilde{\phi}(\pi(x)), $$ where $\pi(x) \in X /\sim$. So $\tilde{\phi}$ is surjective.
Conversely, suppose that $\tilde{\phi}$ is surjective. Given $y \in Y$, there exists $z \in X/\sim$ such that $\tilde{\phi}(z) = y$. As $\pi$ is surjective, there exists $x \in X$ such that $\pi(x) = z$. So $$ y = \tilde{\phi}(z) = \tilde{\phi}(\pi(x)) = (\tilde{\phi} \circ \pi)(x) = \phi(x), $$ so $\phi$ is surjective.