[proofplan]
For the covariant statement, compare the two representations by forming the natural isomorphism $\gamma=\alpha^{-1}\circ\beta$ between the two Hom-functors. Naturality forces every component of $\gamma$ to be postcomposition with the single morphism $u=\gamma_B(\operatorname{id}_B):A\to B$. Applying the same construction to $\gamma^{-1}$ gives a morphism $v:B\to A$, and the component formulas imply that $u$ and $v$ are inverse isomorphisms. The uniqueness follows by evaluating the required identity at $X=B$ and $f=\operatorname{id}_B$. The contravariant case is the same argument with precomposition in place of postcomposition.
[/proofplan]
[step:Form the comparison natural isomorphism between the two Hom-functors]
For each object $X \in \operatorname{Ob}(\mathcal C)$, define a function
\begin{align*}
\gamma_X:\operatorname{Hom}_{\mathcal C}(B,X) &\to \operatorname{Hom}_{\mathcal C}(A,X) \\
f &\mapsto \alpha_X^{-1}(\beta_X(f)).
\end{align*}
Since $\alpha$ and $\beta$ are natural isomorphisms, each $\gamma_X$ is a bijection, and the family
\begin{align*}
\gamma:\operatorname{Hom}_{\mathcal C}(B,-) \Rightarrow \operatorname{Hom}_{\mathcal C}(A,-)
\end{align*}
is a natural isomorphism.
Define the morphism $u:A\to B$ by
\begin{align*}
u:=\gamma_B(\operatorname{id}_B),
\end{align*}
where $\operatorname{id}_B:B\to B$ is the identity morphism of $B$.
[/step]
[step:Use naturality to identify every component as postcomposition with $u$]
Let $X \in \operatorname{Ob}(\mathcal C)$, and let $f:B\to X$ be a morphism. Naturality of $\gamma$ with respect to $f:B\to X$ says that the diagram
\begin{align*}
\operatorname{Hom}_{\mathcal C}(B,B)
&\xrightarrow{\gamma_B}
\operatorname{Hom}_{\mathcal C}(A,B) \\
\operatorname{Hom}_{\mathcal C}(B,f)\downarrow
&\hspace{2.5em}
\downarrow \operatorname{Hom}_{\mathcal C}(A,f) \\
\operatorname{Hom}_{\mathcal C}(B,X)
&\xrightarrow{\gamma_X}
\operatorname{Hom}_{\mathcal C}(A,X)
\end{align*}
commutes. Here
\begin{align*}
\operatorname{Hom}_{\mathcal C}(B,f):\operatorname{Hom}_{\mathcal C}(B,B)&\to \operatorname{Hom}_{\mathcal C}(B,X),
&
h&\mapsto f\circ h,
\\
\operatorname{Hom}_{\mathcal C}(A,f):\operatorname{Hom}_{\mathcal C}(A,B)&\to \operatorname{Hom}_{\mathcal C}(A,X),
&
k&\mapsto f\circ k.
\end{align*}
Evaluating the commuting square at $\operatorname{id}_B$ gives
\begin{align*}
\gamma_X(f)
&=\gamma_X(f\circ \operatorname{id}_B) \\
&=\gamma_X\bigl(\operatorname{Hom}_{\mathcal C}(B,f)(\operatorname{id}_B)\bigr) \\
&=\operatorname{Hom}_{\mathcal C}(A,f)\bigl(\gamma_B(\operatorname{id}_B)\bigr) \\
&=f\circ u.
\end{align*}
Therefore, by the definition of $\gamma_X$,
\begin{align*}
\beta_X(f)=\alpha_X(\gamma_X(f))=\alpha_X(f\circ u).
\end{align*}
[/step]
[step:Construct the inverse morphism from the inverse natural isomorphism]
For each object $X \in \operatorname{Ob}(\mathcal C)$, define
\begin{align*}
\delta_X:\operatorname{Hom}_{\mathcal C}(A,X) &\to \operatorname{Hom}_{\mathcal C}(B,X) \\
g &\mapsto \beta_X^{-1}(\alpha_X(g)).
\end{align*}
Then
\begin{align*}
\delta:\operatorname{Hom}_{\mathcal C}(A,-) \Rightarrow \operatorname{Hom}_{\mathcal C}(B,-)
\end{align*}
is the inverse natural isomorphism to $\gamma$. Define
\begin{align*}
v:=\delta_A(\operatorname{id}_A),
\end{align*}
so $v:B\to A$.
Applying the preceding naturality calculation to $\delta$ gives, for every object $X \in \operatorname{Ob}(\mathcal C)$ and every morphism $g:A\to X$,
\begin{align*}
\delta_X(g)=g\circ v.
\end{align*}
[/step]
[step:Show that the two morphisms are inverse isomorphisms]
Since $\delta$ is inverse to $\gamma$, we have $\delta_B\circ \gamma_B=\operatorname{id}_{\operatorname{Hom}_{\mathcal C}(B,B)}$. Evaluating at $\operatorname{id}_B$ gives
\begin{align*}
\operatorname{id}_B
&=\delta_B(\gamma_B(\operatorname{id}_B)) \\
&=\delta_B(u) \\
&=u\circ v.
\end{align*}
Similarly, $\gamma_A\circ \delta_A=\operatorname{id}_{\operatorname{Hom}_{\mathcal C}(A,A)}$. Evaluating at $\operatorname{id}_A$ gives
\begin{align*}
\operatorname{id}_A
&=\gamma_A(\delta_A(\operatorname{id}_A)) \\
&=\gamma_A(v) \\
&=v\circ u.
\end{align*}
Thus $u:A\to B$ is an isomorphism with inverse $v:B\to A$.
[/step]
[step:Prove uniqueness by evaluating at the identity of the representing object]
Let $u':A\to B$ be a morphism satisfying
\begin{align*}
\beta_X(f)=\alpha_X(f\circ u')
\end{align*}
for every object $X \in \operatorname{Ob}(\mathcal C)$ and every morphism $f:B\to X$. Take $X=B$ and $f=\operatorname{id}_B$. Then
\begin{align*}
\beta_B(\operatorname{id}_B)
=\alpha_B(\operatorname{id}_B\circ u')
=\alpha_B(u').
\end{align*}
By definition of $u$, we also have
\begin{align*}
\alpha_B(u)
=\alpha_B(\gamma_B(\operatorname{id}_B))
=\beta_B(\operatorname{id}_B).
\end{align*}
Hence $\alpha_B(u')=\alpha_B(u)$. Since $\alpha_B$ is a bijection, it follows that $u'=u$. Therefore the isomorphism $u$ is unique.
[/step]
[step:Repeat the argument contravariantly with precomposition]
Now suppose $F:\mathcal C^{\mathrm{op}}\to \mathbf{Set}$ is represented by both $(A,\alpha)$ and $(B,\beta)$, with
\begin{align*}
\alpha:\operatorname{Hom}_{\mathcal C}(-,A)\Rightarrow F,
\qquad
\beta:\operatorname{Hom}_{\mathcal C}(-,B)\Rightarrow F.
\end{align*}
For each object $X \in \operatorname{Ob}(\mathcal C)$, define
\begin{align*}
\gamma_X:\operatorname{Hom}_{\mathcal C}(X,B)&\to \operatorname{Hom}_{\mathcal C}(X,A)\\
f&\mapsto \alpha_X^{-1}(\beta_X(f)).
\end{align*}
Then $\gamma:\operatorname{Hom}_{\mathcal C}(-,B)\Rightarrow \operatorname{Hom}_{\mathcal C}(-,A)$ is a natural isomorphism. Define
\begin{align*}
u:=\gamma_B(\operatorname{id}_B),
\end{align*}
so $u:B\to A$.
Let $X \in \operatorname{Ob}(\mathcal C)$, and let $f:X\to B$ be a morphism. Naturality of $\gamma$ with respect to $f:X\to B$ gives commutativity of the square whose horizontal maps are $\gamma_B$ and $\gamma_X$, and whose vertical maps are precomposition by $f$. Evaluating at $\operatorname{id}_B$ gives
\begin{align*}
\gamma_X(f)
&=\gamma_X(\operatorname{id}_B\circ f) \\
&=u\circ f.
\end{align*}
Therefore
\begin{align*}
\beta_X(f)=\alpha_X(u\circ f).
\end{align*}
Applying the same construction to the inverse natural isomorphism
\begin{align*}
\delta:\operatorname{Hom}_{\mathcal C}(-,A)\Rightarrow \operatorname{Hom}_{\mathcal C}(-,B)
\end{align*}
gives a morphism $v:A\to B$ such that $\delta_X(g)=v\circ g$ for every $g:X\to A$. Since $\delta$ and $\gamma$ are inverse natural isomorphisms, evaluating at identity morphisms gives
\begin{align*}
u\circ v=\operatorname{id}_A,
\qquad
v\circ u=\operatorname{id}_B.
\end{align*}
Thus $u:B\to A$ is an isomorphism.
Finally, if $u':B\to A$ also satisfies $\beta_X(f)=\alpha_X(u'\circ f)$ for all $X$ and all $f:X\to B$, then taking $X=B$ and $f=\operatorname{id}_B$ gives
\begin{align*}
\alpha_B(u')=\beta_B(\operatorname{id}_B)=\alpha_B(u).
\end{align*}
Since $\alpha_B$ is a bijection, $u'=u$. This proves the contravariant uniqueness statement.
[/step]