Say f: X → Y is a morphism of schemes. The sheaf direct image functor f★ always has a left adjoint, namely the sheaf inverse image functor f★ (with tensoring).
Under what (sufficient) conditions do we know that f★ has a right adjoint? What is it?
Answer to a related question (edit): If f★ preserves quasicoherence, then its restriction to quasicoherents f★: QCoh(X) → QCoh(Y) has a right adjoint when f is affine (in particular, any closed immersion or finite morphism will do). The basic idea is to globalize the affine case (see Eric Wofsey's answer below); thanks to Pablo Solis for pointing me to page 6 of Ravi Vakil's notes explaining this.
In this question, I'm not restricting to the quasi-coherent categories. One reason for working with non-quasicoherents is that j! , the "extension by zero" right adjoint to j★ for an open immersion j, doesn't take qcoh to qcoh.