Suppose $f:A \to B$ is surjective. Define a relation on $A$ by setting $x\sim y$ if $f(x) = f(y)$. It is clear that $\sim$ is an equivalence relation on $A$. Let $\mathcal{E}$ be the set of equivalence classes of $\sim$. Prove that there is a bijection from $\mathcal{E} $ to $B$.
Attempt:
We know $[e] = \{ x : f(e) = f(x) \} $ and $\mathcal{E} = \{ [e] : e \in A \} $. Define $\varphi: \mathcal{E} \to B$ by $\varphi( [e] ) = f(e) $.
First, notice that if $[e] = [e']$, then $\varphi( [e] ) = f(e) = f(e') = \varphi( [e']))$ so $\varphi$ is well defined.
Next, if $f(e) \neq f(e')$ then $(e,e') \notin\; \sim$. So $[e] \neq [e']$ so we have injectivity
Finally, since $f$ is already surjective, we know that for every $b \in B$, there is some $a \in A$ so that $f(a) = b$. So, for every $b \in A$, there is some $e \in A$ (so some $[e] \in \mathcal{E}$) such that $\varphi( [e] ) = f(e) \in B $. so we have surjectivity
Is this an enough argument? thanks
Your proof of injectivity is backwards--you are just proving $\varphi$ is a function again. You want to instead assume $[e]\neq[e']$, and deduce that $f(e)\neq f(e')$. Otherwise, your argument looks good.