Let $\sim$ and $\dot\sim$ be equivanlence relations on the sets X and Y respectively. Suppose $f \in Y^X$ is such that $x \sim y$ implies $f(x) \dot\sim f(y)$ for all $x,y \in X$. Prove that there is a unique function $f_*$ such that the following diagram is commutative.

(source: presheaf.com)
I want to check if I understand correctly.
Diagram is commutative if $pY\circ f=f_*\circ pX$, there are two ways to reach $Y/\dot\sim$.
If $a,b \in X$ and $a\sim b$ then $pY(f(a))=pY(f(b))$ since they form the same equivalence class under $pY$. If $a \nsim b$ then they form two different equivalence classes and they are distinct elements of $Y/\dot\sim$.
If $a,b \in X$ and $a\sim b$ then pX(a)=pX(b). If $a \nsim b$ then they form two equivalence classes.
Our diagram is commutative so there is a function $f_*$ that will take two values from $X/\sim$ to $Y/\dot\sim$.
Take another function, say K from $X/\sim$ to $Y/\dot\sim$ and show that it is equal to $f_*$.
Are these assertions enough to provide the proof?
I will assume that your question deals only with set morphisms. If there is any additional structure (I'm thinking in particular of the notion of quotient topology), the proof below can be extended to account for this structure.
Let $[x]_\sim$ and $[y]_{\overset{\cdot}{\sim}}$ denote the equivalence classes of $x\in X$ and $y\in Y$ under $\sim$ and $\overset{\cdot}{\sim}$ respectively for all $x\in X$ and $y\in Y$. Now define the following:
$$f_*:X/_\sim\to Y/_{\overset{\cdot}{\sim}}:[x]\mapsto[f(x)]$$
This map is well-defined as we have the following for all $x,x'\in X$ (because $\sim$ and $\overset{\cdot}{\sim}$ are equivalence relations and by your assumption that $f$ is constant on classes): \begin{align*} [x]_\sim&=[x']_\sim & \iff && x&\sim x'& \implies && f(x)&\overset{\cdot}{\sim}f(x') \\ &&\iff& &[f(x)]_{\overset{\cdot}{\sim}}&=[f(x')]_{\overset{\cdot}{\sim}} &\iff && f_*([x]_\sim)&=f_*([x']_\sim) \end{align*}
On the other hand we have the following for all $x\in X$:
$$(f_*\circ p_X)(x) =f_*(p_X(x)) =f_*[x]_\sim =[f(x)]_{\overset{\cdot}{\sim}} =p_Y(f(x)) =(p_Y\circ f)(x)$$
Hence the function $f_*$ exists.
To see that $f_*$ is unique, suppose that there is another function $g:X/_\sim\to Y/_{\overset{\cdot}{\sim}}$ such that $g\circ p_X=p_Y\circ f$. By our work above $g\circ p_X=p_Y\circ f=f_*\circ p_X$. We thus have the following for all classes $[x]_\sim\in X/_\sim$ showing that $g=f_*$ is unique:
$$g([x]_\sim)=(g\circ p_X)(x)=(f_*\circ p_X)(x)=f_*(p_X(x))=f_*([x]_\sim)$$
This completes the proof of the desired result.