Given a functor $f:\mathcal{C}\to\mathcal{D}$ and any complete category $\mathcal{A}$ (e.g., take $\mathcal{A}=\text{Sets}$ to get the case you are asking about), there exists a right-adjoint $f_{\ast}:[\mathcal{C},\mathcal{A}]\to[\mathcal{D},\mathcal{A}]$ to the "inverse image functor" $f^{\ast}$ and this is given by taking right Kan extension. Explicitly, given a functor $X:\mathcal{C}\to\mathcal{A}$, the functor $f_{\ast}(X):\mathcal{D}\to\mathcal{A}$ is the right Kan extension of $X$ along $f$. This can be described explicitly using the limit formula $$f_{\ast}(X)(d)=\text{lim}_{d\to f(c)}X(c)$$ for $d$ an object of $\mathcal{D}$ (the action on arrows of $\mathcal{D}$ is then induced by the universal property of limits). The indexing category of the limit here is of course the comma category $(d\downarrow f)$. When $\mathcal{A}$ is cocomplete there is a corresponding left-adjoint $f_{!}\dashv f^{\ast}$ which is given by taking left Kan extension along $f$. This can be explicitly described by the colimit formula dual to the limit formula given above. (I should say that all of this is described very nicely in Mac Lane's book *Categories for the Working Mathematician*.)