Solution (source code)

= Solution

An <isomorphism> $f:A\to B$ gives a <natural isomorphism> $h_f:h_A\to h_B$ by postcomposition, with inverse $h_{f^{-1}}$.

Conversely suppose $\alpha:h_A\to h_B$ is a <natural isomorphism>, with inverse $\beta$. Since the <Yoneda embedding> is a <full and faithful functor>, there are unique $f:A\to B$ and $g:B\to A$ with $h_f=\alpha$ and $h_g=\beta$. Their composites satisfy
$$
h_{gf}=\beta\alpha=1_{h_A}=h_{1_A},\qquad
h_{fg}=\alpha\beta=1_{h_B}=h_{1_B}.
$$
Faithfulness gives $gf=1_A$ and $fg=1_B$. Thus
$$
\boxed{A\cong B\quad\Longleftrightarrow\quad
\mathcal C(-,A)\cong\mathcal C(-,B)\text{ naturally}.}
$$
The <naturality> requirement ensures that all incoming <morphisms> are respected; unrelated componentwise <bijections> alone would not justify the conclusion.