I am trying to prove the following fact
Let functors $K,K':\mathcal{D}^{\text{op}}\to\mathbf{Set}$ have representations $(r,\phi)$ and $(r',\phi')$ respectively. Prove that to each natural transformation $\tau:K\to K'$, there is a unique morphism $h:r\to r'$ of $\mathcal{D}$, such that $$\tau\circ\phi=\phi'\circ\text{Hom}_{\mathcal{D}}(-,h):\text{Hom}_{\mathcal{D}}(-,r)\to \text{Hom}_{\mathcal{D}}(-,r')$$
I think I am in the correct path but I feel I can not phrase exactly the required statement from what I prove:
The composite $\tau\circ \phi$ is a natural transformation $\text{Hom}_{\mathcal{D}}(-,r)\to K'$ in $[\mathcal{D}^{\text{op}},\mathbf{Set}]$. By Yoneda, we have $$\text{Hom}_{[\mathcal{D}^{\text{op}},\mathbf{Set}]}(\text{Hom}_{\mathcal{D}}(-,r),K')\cong K'(r)\cong \text{Hom}_{\mathcal{D}}(r,r')$$ where the last isomorphism holds since $\phi$ is a representation. Therefore, every natural transformation $\text{Hom}_{\mathcal{D}}(-,r)\to K'$ (hence also the composite $\tau\circ \phi$), corresponds to an arrow $r\to r'$ in $\mathcal{D}$.
This looks something like what needs to be proved, but I am not sure how the statement follows, if of course what I am doing is correct. Any help would be appreciated.
The idea it's correct but personally I find more easily to follow the argument when stated in the following way.
More in details it should work like this: by Yoneda lemma we have that every natural transformation of kind $$\tau' \colon \hom_{\mathcal D}(-,r) \Rightarrow \hom_{\mathcal D}(-,r')$$ is of the form $\hom_{\mathcal D}(-,h)$ for some $h \in \hom_{\mathcal D}(r,r')$; now by the hypothesis we have the following natural transformation $$\hom_{\mathcal D}(-,r) \stackrel{\phi}\cong K \stackrel{\tau}{\Rightarrow} K' \stackrel{\phi'^{-1}}{\cong} \hom_{\mathcal D}(-,r')$$ by what we've said above $\phi'^{-1} \circ \tau \circ \phi = \hom_{\mathcal D}(-,h)$ for a certain $h \in \hom_{\mathcal D}(r,r')$.
Now composing on the left both sides of the equation you get that $$\tau \circ \phi = \phi' \circ \hom_{\mathcal D}(-,h)$$ which is exactly what you wanted to prove.
Hope this helps.
Edit: The fact that every natural transformation $$\hom_{\mathcal D}(-,r) \Rightarrow \hom_{\mathcal D}(-,r')$$ is of the form $\hom_{\mathcal D}(-,h)$ for some $h \in \mathcal D(r,r')$ follows in the following way.
By yoneda lemma we have a natural bijection $$[\mathcal D^\text{op},\mathbf{Set}](\hom_{\mathcal D}(-,r),\hom_{\mathcal D}(-,r')) \cong \hom_{\mathcal D}(r,r')$$ the inverse of this bijection is given by the mapping sending every $h \in \hom_{\mathcal D}(r,r')$ in the family of funtions $$\langle g \in \hom_{\mathcal D}(z,r) \mapsto \hom_{\mathcal D}(g,r')(h)=h \circ g \in \hom_{\mathcal D}(z,r')\rangle_{z \in\mathcal D}\ .$$
Since for every $g \in \hom_{\mathcal D}(z,r)$ we have that $$h \circ g = \hom_{\mathcal D}(z,h)(g)$$ we have that mapping above is exactly $\hom_{\mathcal D}(-,h)$.
Summarizing we have that the inverse of the yoneda bijection sends every $h \in \hom_{\mathcal D}(r,r')$ in the natural trasformation $\hom_{\mathcal D}(-,h)$. Since this mapping is a bijection every natural transformation in $[\mathcal D^\text{op},\mathbf{Set}](\hom_{\mathcal D}(-,r),\hom_{\mathcal D}(-,r'))$ is of the form $\hom_{\mathcal D}(-,h)$ for some $h \in \mathcal D(r,r')$.