This question is exercise 4.1.ii form Riehl's category theory in context:
Let $ob: Cat \to Sets$ be the functor that sends a category to its set of objects. Construct left and right adjoints to this functor.
My guess is that the two functors we need construct should be: the functor sending a set $S$ to the category whose objects are $S$ and the only morphisms are idenitity morphisms, and the functor sending $S$ th the category whose objects are $S$ by it has `all' morphisms in some sense.
I'm not sure if the idea of having `all' morphisms is correct. In the case this is correct, I am not sure how to make this precise.
Note that we have an embedding $\mathrm{Set} \xrightarrow{D} \mathrm{Cat}$, which sends a set to a discrete category. For any small category $\mathcal C$, a functor $F: DS \rightarrow \mathcal C$ is just a function on underlying set of objects, as the only arrows are identities, which image is forced. Thus we get the right adjoint $$\operatorname{Funct}(DS, \mathcal C) \simeq \operatorname{Hom}(S, ob(\mathcal C))$$
Now consider a function $f: ob(\mathcal C) \rightarrow S$. The functor $\mathcal C \rightarrow \mathcal D$ correspondending to $f$ can simply taken to be $f$ on sets of objects and trivial on arrows. There is only one canonical codomain category making it possible, the full category $FS$ on $S$, where each pair of objects are connected with unique arrow, so the induced value of a functor on arrows is uniquely determined, thus trivial. This isomorphism provides the other adjoint, as we have
$$\operatorname{Funct}(\mathcal C, FS) \simeq \operatorname{Hom}(ob(\mathcal C), S)$$