Given a set $X$ and an equivalence relation $\sim$ on $X$, define quotient mapping $\pi:X \to X/\sim$, it's known the canonical projection is surjective and this fact follows from definition of equivalence class and the symmetric property of $\sim$.
Theorem:
Define $f:\small X \to B$ such that for every $a,b \in X$ if $a \sim b$ implies $f(a)=f(b)$, then there exist a unique function $G:\small {X/\sim} \to B$, such that $f = g\pi$. If f is a surjection and $a \sim b ↔ f(a) = f(b)$, then $g$ is a bijection.
If $f$ is surjective then so is $g$, form where the injectively of $g$ follows?and why $g$ is unique?
Also what is the application of this theorem?