Let $f:X \to Y$ be a surjective function from a set $X$ onto a set $Y$. Let $R$ be the subset of $X \times X$ consisting of those pairs $(x,x')$ such that $f(x) =f(x')$. Prove that $R$ is an equivalence relation. Let $\pi : X \to X/R$ be the projection. Verify that, if $\alpha \in X/R$ is an equivalence class, to define $F(\alpha) = f(a)$ whenever $\alpha = \pi (a)$ establishes a well-defined function $F:X/R \to Y$ that is surjective and injective.
My work: $R$ is an equivalence relation is clear.
$F$ is well-defined: Let $\alpha = \pi (a) = \pi (b) = \beta$. Then $F(\alpha ) = f(a) = f(b) = F(\beta)$.
$F$ is injective: Let $F(\alpha ) = f(a) = f(b) = F(\beta)$. Then $ \pi (a) = \pi (b) $ and hence $\alpha = \beta$.
$F$ is surjective: Let $y \in Y$. Since $f$ is surjective there is $x$ with $f(x) =y$. Hence $F(\pi(x)) = f(x) = y$.
Thank you for correcting me..