I'm trying to learn a little about Grothendieck duality. One version of the theorem states that if $f: X \to Y$ is a proper morphism of schemes, then the induced functor on derived categories $f\_\*: D^+(\mathrm{QCoh}(X)) \to D^+(\mathrm{QCoh}(Y))$ has a right adjoint $f^!$ (and under nice hypotheses, these will preserve the subcategories with coherent cohomology). The existence of an adjoint can be proved via adjoint functor arguments, even without assuming $f$ proper; this was done, e.g., by Neeman. (The point is that a triangulated functor between nice triangulated categories (or, stable $\infty$-categories) which preserves coproducts is a left adjoint.) 


However, in trying to identify $f^{!}$, we might want to be able to localize on $X$ and $Y$, and thus deal with the non-proper case. My understanding is that the upper-shriek functor $f^{!}$ there is not supposed to be the right adjoint to $f\_{\ast}$: for example, for an open immersion it should be the upper-star $f^\*$. 


In the topological version, one can define a $f\_{!}$ functor for sheaves (push-forward with compact support) and $f^!$ is the right adjoint to $f\_{!}$. Is there any "functorial" way to interpret $f^{!}$ when $f$ is not proper? 



What is the upper shriek in Grothendieck duality in the non-proper case? 
Classically, the functor $f^!$ is indeed not a right adjoint in general. Clausen and I have recently found a way to make it a right adjoint in general, by enlarging the category of modules to that of solid modules, and constructing a general $f\_!$ functor on solid modules directly. Solid modules are a version of "completed topological modules", but with excellent categorical properties. As an example, for $f: \mathbb A^1 =\mathrm{Spec} \mathbb Z[T]\to \mathrm{Spec}\mathbb Z$, one has
$$
f\_! \mathcal O\_{\mathbb A^1} = \left[\mathbb Z[T]\to \mathbb Z((T^{-1}))\right],
$$
the idea being that one wants to look at those functions $f\in \mathbb Z[T]$ that vanish to all orders at $\infty$, i.e. lie in the kernel of $\mathbb Z[T]\to \mathbb Z((T^{-1}))$. This kernel is of course trivial, but there's an interesting cokernel, so it gives an interesting functor on the derived level. And it's really necessary to consider $\mathbb Z((T^{-1}))$ not as an abstract $\mathbb Z$-module, but with its topological (or rather condensed) structure. See [here](https://www.math.uni-bonn.de/people/scholze/Condensed.pdf) for an account of this approach to coherent duality.


(I should say that a version of this is due to Deligne in the appendix to Hartshorne "Residues and Duality", working with pro-coherent sheaves.)


