Given the sets $A=${$x_i|1\leq i\leq 9$} and $B=${$y_j|1\leq j\leq 6$} we consider the map $f:A\to B$ defined by: $$f(x_1)=y_1 \qquad f(x_2)=y_1 \qquad f(x_3)=y_3 \\ f(x_4)=y_3 \qquad f(x_5)=y_3 \qquad f(x_6)=y_4 \\ f(x_7)=y_4 \qquad f(x_8)=y_4 \qquad f(x_9)=y_6$$ In the set $A$ we define the following binary relation: $$x_iRx_j \iff f(x_i)=f(x_j)$$ Show that $R$ is an equivalence relation and find the canonical factorization of $f$.
In order to show that $R$ is an equivalence relation I have to comprove that it is reflexive, symmetric, and transitive, so:
$R$ is reflexive: $\forall i\in A \quad iRi\quad f(x_i)=f(x_i)$
$R$ is symmetric: $\forall i,j\in A \quad iRj \quad$then, if $f(x_i)=f(x_j)$, $f(x_j)=f(x_i)$, so $jRi$
$R$ is transitive: $\forall i,j,k\in A\quad iRj\quad jRk\quad$ then we have $f(x_i)=f(x_j)$ and $f(x_j)=f(x_k)$, from which follows $f(x_i)=f(x_k)$, so $iRk$.
Now I have to find the canonical factorization of $f$, but I have no clear idea about how to do it. Could you help me? Thanks!
Hint: You need to formulate two functions $A\to A/R\to B$ such that their composition is $f$.