I need help with this problem: Let $A$ resp. $B$ be a set, endowed with an equivalence relation $\sim_A$ resp. $\sim_B$. Defne a relation $\sim$ on $A \times B$ by setting
$$(a_1, b_1) \sim (a_2, b_2) \Leftrightarrow a_1\sim_A a_2 \ \text{and} \ b_1 \sim_B b_2.$$
Use the universal property for quotients to establish that there are functions
$$(A \times B)/\sim \ \rightarrow \ A/\sim_A$$ and $$(A \times B)/\sim \ \rightarrow \ B/\sim_B.$$
The kernel of a function $f:X\to Y$ is the equivalence relation $\theta_f$ on $X$ which satisfies $$x\,\theta_f\, x' \iff f(x)=f(x') \,.$$ Prove that $f$ factors through $X/R$ for some equivalence relation $R$ iff $R$ implies $\theta_f$ (i.e. $\forall x,x':\, xRx' \Rightarrow x\,\theta_f\, x'$).
Now use the composition $p:A\times B\to A\to A/\sim_A$ and check that $\sim$ implies $\theta_p$.