For a locally small category $\mathcal{C}$, you can embed $\mathcal{C}$ in the functor category $\mathrm{Set}^\mathcal{C}$ via the functor $X \mapsto \mathrm{Hom}_\mathcal{C}(X,{-})$. This embedding is fully faithful by Yoneda's lemma. But for which $\mathcal{C}$ is this embedding essentially surjective too? Asked another way, when is a category $\mathcal{C}$ equivalent to its functor category $\mathrm{Set}^\mathcal{C}$? Asked yet another way, for which categories $\mathcal{C}$ is every functor $\mathcal{C} \to \mathrm{Set}$ representable?
For which categories is its Yoneda embedding essentially surjective
category-theoryexamples-counterexamplesrepresentable-functoryoneda-lemma
Related Solutions
Without the cocompleteness condition, these were studied in G. M. Kelly's paper "A survey of totality for enriched and ordinary categories" under the name compact categories, and in this mathoverflow question under the much better name saft categories (after the Special Adjoint Functor Theorem).
In that question, Theo Johnson-Freyd gives the following equivalent characterisations:
Theorem. Let $\mathbf{C}$ be a locally small category. Then the following are equivalent:
Every continuous functor $\mathbf{C}^\mathrm{op}\to\mathbf{Set}$ is representable.
For all locally small $\mathbf{D}$, every cocontinuous functor $\mathbf{C}\to\mathbf{D}$ has a right adjoint.
Proof. (1) $\Rightarrow$ (2) Let $F:\mathbf{C}\to\mathbf{D}$ be cocontinuous. For $d\in\mathbf{D}$ the functor $\mathrm{Hom}(F(-),d):\mathbf{C}^\mathrm{op}\to\mathbf{Set}$ is continuous, and hence representable by an object $G(d)\in\mathbf{C}$. Then given any $c\in\mathbf{C}$ we have $\mathrm{Hom}(F(c),d)\simeq\mathrm{Hom}(c,G(d))$, which [by Categories for the Working Mathematician IV.2.ii] is enough to establish that $F$ has a right adjoint agreeing with $G$ on objects.
(2) $\Rightarrow$ (1) Let $F:\mathbf{C}^\mathrm{op}\to\mathbf{Set}$ be continuous. Then $F^\mathrm{op}:\mathbf{C}\to\mathbf{Set}^\mathrm{op}$ is cocontinuous and $\mathbf{Set}^\mathrm{op}$ is locally small, so $F^\mathrm{op}$ has a right adjoint $G$. Then $F$ is represented by $G(1)$ since $F(c)\simeq\mathrm{Hom}_\mathbf{Set}(1,F(c))\simeq\mathrm{Hom}_{\mathbf{Set}^\mathrm{op}}(F(c),1)\simeq\mathrm{Hom}_\mathbf{C}(c,G(1))$. $\square$
They also point out that every saft category must be complete (since for any small diagram $F:\mathbf{K}\to\mathbf{C}$ the functor $\lim_{k\in K}\mathrm{Hom}(-,F(k)):\mathbf{C}^\mathrm{op}\to\mathbf{Set}$ is continuous, and hence representable by an object of $\mathbf{C}$ which is therefore the limit of $F$). Interestingly they don't have to be cocomplete, a property normally needed for the SAFT.
There is an interesting variation of the Yoneda lemma at play here.
Note that a transformation with components $\phi_{X,Y}\colon C(X,Y)\to D(FX,FY)$ given by $\phi_{X,Y}:f\mapsto Ff$ is natural if and only if $F$ is a functor. Moreover, $F$ is full, resp. faithful, resp. fully faithful, if and only if the components are surjections, resp. injections, resp. bijections
The variation is then this: any natural transformation $\alpha\colon C(X,Y)\to D(FX,FY)$ is of the form $D(\beta,FY)\circ\phi=D(FX,\beta)\circ\phi$ for a natural transformation $\beta$ from $F$ to itself with components $\beta_X=\alpha_{X,X}(\mathrm{id}_X)$.
Indeed, naturality in $Y$ of $\alpha\colon C(X,Y)\to D(FX,FY)$ implies $\alpha_{X,Y}(f)=\alpha_{X,Y}\circ C(X,f)(\mathrm{id_X})=D(FX,Ff)\circ\alpha_{X,X}(\mathrm{id}_X)=Ff\circ\beta_X$ where $\beta_X=\alpha_{X,X}(\mathrm{id_X})\in D(FX,FY)$, while naturaliry in $X$ implies $\alpha_{X,Y}(f)=\beta_Y\circ Ff$. In particular, $Ff\circ\beta_X=\alpha_{X,Y}(f)=\beta_Y\circ Ff$, asserts exactly that $\beta$ is a natural transformation from $F$ to itself such that $D(\beta,FY)\circ\phi=\alpha=D(FX,\beta)\circ\phi$.
We now claim that if $\alpha_{X,X}$ are surjective, then $\beta$ is a natural isomorphism from $F$ to itself, whence $D(FX,\beta)$ and $D(\beta,FY)$ are natural bijections from $D(FX,FY)$ to $D(FX,FY)$ by which $\alpha$ and $\phi$ are related. In particular, $\alpha$ a natural bijection implies $\phi$ is a natural bijection, e.g. (YL-wtih-naturality) implies (YET).
Indeed, if $\alpha_{X,X}$ are surjective, then $\mathrm{id}_{FX}=Fs\circ j_X=j_X\circ Ft$ for some $s,t\in C(X,X)$, whence $Fs=Ft=\beta_X^{-1}$ are the unique two-sided inverses of $\beta_X$, from which follows that the natural transformation $\beta$ has an inverse $\beta^{-1}$.
Best Answer
The Yoneda embedding is never essentially surjective.
To see why, note that the constant empty set functor $C_{\varnothing} : \mathcal{C} \to \mathbf{Set}$ is never representable, since for each $X \in \mathcal{C}$ we have $C_{\varnothing}(X) = \varnothing$ but $\mathrm{id}_X \in \mathrm{Hom}(X,X)$, so that $C_{\varnothing} \ncong \mathrm{Hom}(X,{-})$.