Prove that exists an unique $f_*$ s.t. the diagram is commutative I need some hint to write this proof... I don't know where start or how to formalize it. The problem says

Let $\sim$ and $\overset{.}{\sim}$ be equivalence relations in $X$ and $Y$ respectively. Suppose that a function $f\in Y^X$ is such that $x\sim y$ implies $f(x)\overset{.}{\sim}f(y)$ for all $x,y\in X$. Prove that there is an unique function $f_*$ such that the diagram below is commutative
$$\require{AMScd}
\begin{CD}
X @>{f}>> Y\\
@V{p_X}VV @VV{p_Y}V \\
X/{\sim} @>{f_*}>> Y/{\overset{.}{\sim}}
\end{CD}$$
where $p_X$ is defined as
$$p_X:X\to X/{\sim},\quad x\mapsto [x]$$
where $[x]=\{y\in X: x\sim y\}$ is the equivalence class of $x$, and $p_Y$ is defined similarly.

To the diagram be commutative we need that $p_Y\circ f =f_*\circ p_X$. For some $x_0\in X$ we have that $f(x_0)=y_0$ and $p_X(x_0)=[x_0]$. Then $p_Y(y_0)=[y_0]$ and should be $f_*([x_0])=[y_0]$.
It is "obvious" that $f_*$ is an unique set valued function that map some equivalence class of $X/{\sim}$ to other equivalence class of $Y/{\overset{.}{\sim}}$, but I don't know how to formalize this perception.
I can says that $f_*$ must be injective cause the relation $x\sim y\implies f(x)\overset{.}{\sim}f(y)$ is injective.
Can you help me please? Thank you in advance.    
 A: Define $$\begin{matrix}f_*:&X/{\sim}&\longrightarrow&Y/{\overset{.}\sim}\\&[x]&\longmapsto&[f(x)]\end{matrix}$$
We need to prove that $f_*$ is well-defined and the diagram above is commutative.
First, if $x\sim y$ then $f(x)\overset{.}{\sim}f(y)$, i.e., $[x]=[y]$, implies $[f(x)]=[f(y)]$. So if $[x]=[y]$ we have $f_*(x)=f_*(y)$.
Now, for all $x\in X$, $$f_*\circ p_X(x)=f_*([x])=[f(x)]=p_Y(f(x))=p_Y\circ f(x),$$ so $f_*\circ p_X=p_Y\circ f$.
For uniqueness, if $g:X/\sim\longrightarrow Y/\overset{.}\sim$ is such that $g\circ p_X=p_Y\circ f$, then, for all $[x]\in X/\sim$, we have $$g([x])=g\circ p_X(x)=p_Y\circ f(x)=f_*\circ p_X(x)=f_*([x]),$$ thus $g=f_*$.
A: HINT: The only reasonable candidate for $f_*$ is the function defined by $f_*([x])=[f(x)]$, provided that this $f_*$ is actually well-defined. What you have to do is show that it is well-defined, meaning that if $[x_0]=[x_1]$, then $f_*([x_0])=f_*([x_1])$, i.e., that $[f(x_0)]=[f(x_1)]$. This is straightforward, and it’s not hard to check that the diagram commutes. 
All that remains then is to show that $f_*$ is unique, i.e., that if $g:X/{\sim}\to Y/{\overset{.}\sim}$ makes the diagram commute, then $g=f_*$. This can be done by starting with an arbitrary $[x]\in X/{\sim}$, for which of course $f_*([x])=[f(x)]$, and using the commutativity of the diagram to show that $g([x])$ must also be $[f(x)]$.
A: If for brevity we write $p_Y \circ f$ as $q$, the given property of $f$ can be written as
$$
\tag{*}\label{respect}
p_X(x) = p_X(x') \text{ implies } q(x) = q(x') \text{ for all } x, x' \in X,
$$
and the condition to be satisfied by $f_*$ is
$$
f_*(p_X(x)) = q(x) \text{ for all } x \in X.
$$
In view of \eqref{respect}, and the fact that $p_X$ is surjective, we can define $f_*$ explicitly by
$$
f_*(z) = \iota\{q(x) : x \in X, \ p_X(x) = z\} \text{ for all } z \in X/{\sim},
$$
where $\iota{S}$ denotes the unique element of a set $S$ if it has only one element.
(Or at least we could, if only some such notation were in common use.)
