I asked this very basic question about Grothendieck Duality on Stack--exchange some time ago, without any replies. https://math.stackexchange.com/q/4378894/684496 I'm therefore asking the question here to test my luck. Let $f:X\to Y$ be a morphism of schemes such that $f^!$ exists. Let $A'$ be in the derived category of $\mathcal{S}(Y)$ and $A$ be in the derived category of $\mathcal{S}(X)$. Grothendieck duality assures a bijection of sets $$\textbf{Hom}(A,f^!A')\to \textbf{Hom}(Rf_*A,A')$$ Here $\textbf{Hom}$ is the set of Homomorphisms in the derived category, we also have $H^0\textbf{RHom}=\textbf{Hom}$. I am wondering if the following natural morphism in the derived category of $\mathcal{S}(Y)$ is an isomorphism? Let $A,B\in \mathcal{S}(X)$. Since $Rf_*$ is a functor from the derived category of $\mathcal{S}(X)$ to the derived category of $\mathcal{S}(Y)$ there is an induced morphism $Rf_*(\textbf{Hom}(A,B))\to \textbf{Hom}(Rf_*A,Rf_*B)$. Now if we let $B=f^!A'$ for some $A'$ in the derived category of $\mathcal{S}(Y)$ the Grothendieck trace map induces a morphism $$\textbf{Hom}(Rf_*A,Rf_*f^!A')\to \textbf{Hom}(Rf_*A,A')$$ Is this composition an isomorphism? I.e., is $$Rf_*(\textbf{Hom}(A,f^!A'))\to \textbf{Hom}(Rf_*A,A')$$ an isomorphism? By Grothendieck duality $$Rf_*\textbf{RHom}(A,f^!A')\to \textbf{RHom}(Rf_*A,A')$$ is an isomorphism but if we apply $H^0$ to this we get $$H^0Rf_*\textbf{RHom}(A,f^!A')\to \textbf{Hom}(Rf_*A,A')$$ Which seems pretty far from what I wanted unless if $f_*$ is exact. Thank you for any input!