hcju/stacksqa huggingface dataset:
Assume there exists an irreducible component $X' \subset X$ (which we view as an integral closed subscheme) which is proper and has dimension $d$. Let $\omega_{X'}$ be a dualizing module of $X'$ over $k$, see Lemma \ref{lemma-duality-proper-over-field}. Then $H^d(X', \omega_{X'})$ is nonzero as it is dual to $H^0(X', \mathcal{O}_{X'})$ by the lemma. Hence we see that $H^d(X, \omega_{X'}) = H^d(X', \omega_{X'})$ is nonzero and we conclude that (1) does not hold. In this way we see that (1) implies (3). \medskip\noindent Let us prove that (3) implies (1). Let $\mathcal{F}$ be a coherent $\mathcal{O}_X$-module such that $H^d(X, \mathcal{F})$ is nonzero. Choose a filtration $$ 0 = \mathcal{F}_0 \subset \mathcal{F}_1 \subset \ldots \subset \mathcal{F}_m = \mathcal{F} $$ as in Cohomology of Schemes, Lemma \ref{coherent-lemma-coherent-filter}. We obtain exact sequences $$ H^d(X, \mathcal{F}_i) \to H^d(X, \mathcal{F}_{i + 1}) \to H^d(X, \mathcal{F}_{i + 1}/\mathcal{F}_i) $$ Thus for some $i \in \{1, \ldots, m\}$ we find that $H^d(X, \mathcal{F}_{i + 1}/\mathcal{F}_i)$ is nonzero. By our choice of the filtration this means that there exists an integral closed subscheme $Z \subset X$ and a sheaf of ideals $\mathcal{I} \subset \mathcal{O}_Z$ such that $H^d(Z, \mathcal{I})$ is nonzero. By Lemma \ref{lemma-lichtenbaum} we conclude $\dim(Z) = d$ and $Z$ is proper over $k$ contradicting (3). Hence (3) implies (1). \medskip\noindent Finally, let us show that (1) and (2) are equivalent for any Noetherian scheme $X$. Namely, (2) trivially implies (1). On the other hand, assume (1) and let $\mathcal{F}$ be a quasi-coherent $\mathcal{O}_X$-module. Then we can write $\mathcal{F} = \colim \mathcal{F}_i$ as the filtered colimit of its coherent submodules, see Properties, Lemma \ref{properties-lemma-quasi-coherent-colimit-finite-type}. Then we have $H^d(X, \mathcal{F}) = \colim H^d(X, \mathcal{F}_i) = 0$ by Cohomology, Lemma \ref{cohomology-lemma-quasi-separated-cohomology-colimit}. Thus (2) is true.
Assume (2) and let $U = \Spec(A)$ be an affine open of $X$. Since condition (2) implies that $K$ is in $D_\QCoh(\mathcal{O}_X)$ we find an object $\omega_A^\bullet$ in $D(A)$ whose associated complex of quasi-coherent sheaves is isomorphic to $K|_U$, see Derived Categories of Schemes, Lemma \ref{perfect-lemma-affine-compare-bounded}. We will show that $\omega_A^\bullet$ is a dualizing complex for $A$ which will finish the proof. \medskip\noindent Since $X = \bigcup U_i$ is an open covering, we can find a standard open covering $U = D(f_1) \cup \ldots \cup D(f_m)$ such that each $D(f_j)$ is a standard open in one of the affine opens $U_i$, see Schemes, Lemma \ref{schemes-lemma-standard-open-two-affines}. Say $D(f_j) = D(g_j)$ for $g_j \in A_{i_j}$. Then $A_{f_j} \cong (A_{i_j})_{g_j}$ and we have $$ (\omega_A^\bullet)_{f_j} \cong (\omega_i^\bullet)_{g_j} $$ in the derived category by Derived Categories of Schemes, Lemma \ref{perfect-lemma-affine-compare-bounded}. By Dualizing Complexes, Lemma \ref{dualizing-lemma-dualizing-localize} we find that the complex $(\omega_A^\bullet)_{f_j}$ is a dualizing complex over $A_{f_j}$ for $j = 1, \ldots, m$. This implies that $\omega_A^\bullet$ is dualizing by Dualizing Complexes, Lemma \ref{dualizing-lemma-dualizing-glue}.
We may assume that $L$ is given by a finite complex $I^\bullet$ of injective $A$-modules. By induction on the length of $I^\bullet$ and compatibility of the constructions with distinguished triangles, we reduce to the case that $L = I[0]$ where $I$ is an injective $A$-module. In this case, Derived Categories of Schemes, Lemma \ref{perfect-lemma-quasi-coherence-internal-hom}, tells us that the $n$th cohomology sheaf of $R\SheafHom_{\mathcal{O}_X}(\widetilde{K}, \widetilde{L})$ is the sheaf associated to the presheaf $$ D(f) \longmapsto \Ext^n_{A_f}(K \otimes_A A_f, I \otimes_A A_f) $$ Since $A$ is Noetherian, the $A_f$-module $I \otimes_A A_f$ is injective (Dualizing Complexes, Lemma \ref{dualizing-lemma-localization-injective-modules}). Hence we see that \begin{align*} \Ext^n_{A_f}(K \otimes_A A_f, I \otimes_A A_f) & = \Hom_{A_f}(H^{-n}(K \otimes_A A_f), I \otimes_A A_f) \\ & = \Hom_{A_f}(H^{-n}(K) \otimes_A A_f, I \otimes_A A_f) \\ & = \Hom_A(H^{-n}(K), I) \otimes_A A_f \end{align*} The last equality because $H^{-n}(K)$ is a finite $A$-module, see Algebra, Lemma \ref{algebra-lemma-hom-from-finitely-presented}. This proves that the canonical map $$ \widetilde{R\Hom_A(K, L)} \longrightarrow R\SheafHom_{\mathcal{O}_X}(\widetilde{K}, \widetilde{L}) $$ is a quasi-isomorphism in this case and the proof is done.
Proof of (1). We say $M$ has affine locally finite injective dimension if $X$ has an open covering by affines $U = \Spec(A)$ such that the object of $D(A)$ corresponding to $M|_U$ (Derived Categories of Schemes, Lemma \ref{perfect-lemma-affine-compare-bounded}) has finite injective dimension\footnote{This condition is independent of the choice of the affine open cover of the Noetherian scheme $X$. Details omitted.}. To prove the lemma we may replace $X$ by $U$, i.e., we may assume $X = \Spec(A)$ for some Noetherian ring $A$. Observe that $R\SheafHom(K, L)$ is in $D^+_{\textit{Coh}}(\mathcal{O}_X)$ by Derived Categories of Schemes, Lemma \ref{perfect-lemma-coherent-internal-hom}. Moreover, the formation of the left and right hand side of the arrow commutes with the functor $D(A) \to D_\QCoh(\mathcal{O}_X)$ by Lemma \ref{lemma-affine-duality} and Derived Categories of Schemes, Lemma \ref{perfect-lemma-quasi-coherence-internal-hom} (to be sure this uses the assumptions on $K$, $L$, $M$ and what we just proved about $R\SheafHom(K, L)$). Then finally the arrow is an isomorphism by More on Algebra, Lemmas \ref{more-algebra-lemma-internal-hom-evaluate-isomorphism} part (2). \medskip\noindent Proof of (2). We argue as above. A small change is that here we get $R\SheafHom(K, L)$ in $D_{\textit{Coh}}(\mathcal{O}_X)$ because affine locally (which is allowable by Lemma \ref{lemma-affine-duality}) we may appeal to Dualizing Complexes, Lemma \ref{dualizing-lemma-finite-ext-into-bounded-injective}. Then we finally conclude by More on Algebra, Lemma \ref{more-algebra-lemma-internal-hom-evaluate-isomorphism-technical}.
Let $U \subset X$ be an affine open. Say $U = \Spec(A)$ and let $\omega_A^\bullet$ be a dualizing complex for $A$ corresponding to $K|_U$ as in Lemma \ref{lemma-equivalent-definitions}. By Lemma \ref{lemma-affine-duality} the diagram $$ \xymatrix{ D_{\textit{Coh}}(A) \ar[r] \ar[d]_{R\Hom_A(-, \omega_A^\bullet)} & D_{\textit{Coh}}(\mathcal{O}_U) \ar[d]^{R\SheafHom_{\mathcal{O}_X}(-, K|_U)} \\ D_{\textit{Coh}}(A) \ar[r] & D(\mathcal{O}_U) } $$ commutes. We conclude that $D$ sends $D_{\textit{Coh}}(\mathcal{O}_X)$ into $D_{\textit{Coh}}(\mathcal{O}_X)$. Moreover, the canonical map $$ L \longrightarrow R\SheafHom_{\mathcal{O}_X}(K, K) \otimes_{\mathcal{O}_X}^\mathbf{L} L \longrightarrow R\SheafHom_{\mathcal{O}_X}(R\SheafHom_{\mathcal{O}_X}(L, K), K) $$ (using Cohomology, Lemma \ref{cohomology-lemma-internal-hom-evaluate} for the second arrow) is an isomorphism for all $L$ because this is true on affines by Dualizing Complexes, Lemma \ref{dualizing-lemma-dualizing}\footnote{An alternative is to first show that $R\SheafHom_{\mathcal{O}_X}(K, K) = \mathcal{O}_X$ by working affine locally and then use Lemma \ref{lemma-internal-hom-evaluate-isom} part (2) to see the map is an isomorphism.} and we have already seen on affines that we recover what happens in algebra. The statement on boundedness properties of the functor $D$ in the quasi-compact case also follows from the corresponding statements of Dualizing Complexes, Lemma \ref{dualizing-lemma-dualizing}.
Set $$ L = R\SheafHom_{\mathcal{O}_X}(K, K') $$ This is an invertible object of $D(\mathcal{O}_X)$, because affine locally this is true, see Dualizing Complexes, Lemma \ref{dualizing-lemma-dualizing-unique} and its proof. The evaluation map $L \otimes_{\mathcal{O}_X}^\mathbf{L} K \to K'$ is an isomorphism for the same reason.
Lemma \ref{lemma-dualizing-schemes} tells us that $\mathcal{E}^i$ is coherent. Choosing an affine neighbourhood of $x$ and using Derived Categories of Schemes, Lemma \ref{perfect-lemma-quasi-coherence-internal-hom} and More on Algebra, Lemma \ref{more-algebra-lemma-base-change-RHom} part (3) we have $$ \mathcal{E}^i_x = \SheafExt^{-i}_{\mathcal{O}_X}(\mathcal{F}, \omega_X^\bullet)_x = \Ext^{-i}_{\mathcal{O}_{X, x}}(\mathcal{F}_x, \omega_{X, x}^\bullet) = \Ext^{\delta(x) - i}_{\mathcal{O}_{X, x}}(\mathcal{F}_x, \omega_{X, x}^\bullet[-\delta(x)]) $$ By construction of $\delta$ in Lemma \ref{lemma-dimension-function-scheme} this reduces parts (1), (2), and (3) to Dualizing Complexes, Lemma \ref{dualizing-lemma-sitting-in-degrees}. Part (4) is a formal consequence of (3) and (1).
We will prove a right adjoint exists by verifying the hypotheses of Derived Categories, Proposition \ref{derived-proposition-brown}. First off, the category $D_\QCoh(\mathcal{O}_X)$ has direct sums, see Derived Categories of Schemes, Lemma \ref{perfect-lemma-quasi-coherence-direct-sums}. The category $D_\QCoh(\mathcal{O}_X)$ is compactly generated by Derived Categories of Schemes, Theorem \ref{perfect-theorem-bondal-van-den-Bergh}. Since $X$ and $Y$ are quasi-compact and quasi-separated, so is $f$, see Schemes, Lemmas \ref{schemes-lemma-compose-after-separated} and \ref{schemes-lemma-quasi-compact-permanence}. Hence the functor $Rf_*$ commutes with direct sums, see Derived Categories of Schemes, Lemma \ref{perfect-lemma-quasi-coherence-pushforward-direct-sums}. This finishes the proof.
By Derived Categories of Schemes, Lemma \ref{perfect-lemma-quasi-coherence-direct-image} the functor $Rf_*$ has finite cohomological dimension. In other words, there exist an integer $N$ such that $H^i(Rf_*L) = 0$ for $i \geq N + c$ if $H^i(L) = 0$ for $i \geq c$. Say $K \in D^+_\QCoh(\mathcal{O}_Y)$ has $H^i(K) = 0$ for $i \leq c$. Then $$ \Hom_{D(\mathcal{O}_X)}(\tau_{\leq c - N}a(K), a(K)) = \Hom_{D(\mathcal{O}_Y)}(Rf_*\tau_{\leq c - N}a(K), K) = 0 $$ by what we said above. Clearly, this implies that $H^i(a(K)) = 0$ for $i \leq c - N$.
The statement makes sense as $DQ_Y$ exists by Derived Categories of Schemes, Lemma \ref{perfect-lemma-better-coherator}. Since $DQ_Y$ is the right adjoint to the inclusion functor $D_\QCoh(\mathcal{O}_Y) \to D(\mathcal{O}_Y)$ to prove the lemma we have to show that for any $M \in D_\QCoh(\mathcal{O}_Y)$ the map (\ref{equation-sheafy-trace}) induces an bijection $$ \Hom_Y(M, Rf_*R\SheafHom_{\mathcal{O}_X}(L, a(K))) \longrightarrow \Hom_Y(M, R\SheafHom_{\mathcal{O}_Y}(Rf_*L, K)) $$ To see this we use the following string of equalities \begin{align*} \Hom_Y(M, Rf_*R\SheafHom_{\mathcal{O}_X}(L, a(K))) & = \Hom_X(Lf^*M, R\SheafHom_{\mathcal{O}_X}(L, a(K))) \\ & = \Hom_X(Lf^*M \otimes_{\mathcal{O}_X}^\mathbf{L} L, a(K)) \\ & = \Hom_Y(Rf_*(Lf^*M \otimes_{\mathcal{O}_X}^\mathbf{L} L), K) \\ & = \Hom_Y(M \otimes_{\mathcal{O}_Y}^\mathbf{L} Rf_*L, K) \\ & = \Hom_Y(M, R\SheafHom_{\mathcal{O}_Y}(Rf_*L, K)) \end{align*} The first equality holds by Cohomology, Lemma \ref{cohomology-lemma-adjoint}. The second equality by Cohomology, Lemma \ref{cohomology-lemma-internal-hom}. The third equality by construction of $a$. The fourth equality by Derived Categories of Schemes, Lemma \ref{perfect-lemma-cohomology-base-change} (this is the important step). The fifth by Cohomology, Lemma \ref{cohomology-lemma-internal-hom}.
By the construction in Cohomology, Section \ref{cohomology-section-global-RHom} we have $$ R\Hom_X(L, a(K)) = R\Gamma(X, R\SheafHom_{\mathcal{O}_X}(L, a(K))) = R\Gamma(Y, Rf_*R\SheafHom_{\mathcal{O}_X}(L, a(K))) $$ and $$ R\Hom_Y(Rf_*L, K) = R\Gamma(Y, R\SheafHom_{\mathcal{O}_Y}(Rf_*L, K)) $$ Thus the lemma is a consequence of Lemma \ref{lemma-iso-on-RSheafHom}. Namely, a map $E \to E'$ in $D(\mathcal{O}_Y)$ which induces an isomorphism $DQ_Y(E) \to DQ_Y(E')$ induces a quasi-isomorphism $R\Gamma(Y, E) \to R\Gamma(Y, E')$. Indeed we have $H^i(Y, E) = \Ext^i_Y(\mathcal{O}_Y, E) = \Hom(\mathcal{O}_Y[-i], E) = \Hom(\mathcal{O}_Y[-i], DQ_Y(E))$ because $\mathcal{O}_Y[-i]$ is in $D_\QCoh(\mathcal{O}_Y)$ and $DQ_Y$ is the right adjoint to the inclusion functor $D_\QCoh(\mathcal{O}_Y) \to D(\mathcal{O}_Y)$.
In this case the base change map $Lg^* \circ Rf_* K \longrightarrow Rf'_* \circ L(g')^*K$ is an isomorphism for every $K$ in $D_\QCoh(\mathcal{O}_X)$ by Derived Categories of Schemes, Lemma \ref{perfect-lemma-compare-base-change}. Thus the corresponding transformation between adjoint functors is an isomorphism as well.
Proof of (1). Let $K \in D_\QCoh^+(\mathcal{O}_Y)$. Choose a distinguished triangle $$ K \to Rj_*K|_V \to Q \to K[1] $$ Observe that $Q$ is in $D_\QCoh^+(\mathcal{O}_Y)$ (Derived Categories of Schemes, Lemma \ref{perfect-lemma-quasi-coherence-direct-image}) and is supported on $Y \setminus V$ (Derived Categories of Schemes, Definition \ref{perfect-definition-supported-on}). Applying $a$ we obtain a distinguished triangle $$ a(K) \to a(Rj_*K|_V) \to a(Q) \to a(K)[1] $$ on $X$. If $a(Q)$ is supported on $X \setminus U$, then restricting to $U$ the map $a(K)|_U \to a(Rj_*K|_V)|_U$ is an isomorphism, i.e., (\ref{equation-sheafy}) is an isomorphism on $K$. The converse is immediate. \medskip\noindent The proof of (2) is exactly the same as the proof of (1). \medskip\noindent Proof of (3). Assume the equivalent conditions of (1) hold. Set $T = Y \setminus V$. We will use the notation $D_{\QCoh, T}(\mathcal{O}_Y)$ and $D_{\QCoh, f^{-1}(T)}(\mathcal{O}_X)$ to denote complexes whose cohomology sheaves are supported on $T$ and $f^{-1}(T)$. Since $a$ commutes with direct sums, the strictly full, saturated, triangulated subcategory $\mathcal{D}$ with objects $$ \{Q \in D_{\QCoh, T}(\mathcal{O}_Y) \mid a(Q) \in D_{\QCoh, f^{-1}(T)}(\mathcal{O}_X)\} $$ is preserved by direct sums and hence derived colimits. On the other hand, the category $D_{\QCoh, T}(\mathcal{O}_Y)$ is generated by a perfect object $E$ (see Derived Categories of Schemes, Lemma \ref{perfect-lemma-generator-with-support}). By assumption we see that $E \in \mathcal{D}$. By Derived Categories, Lemma \ref{derived-lemma-write-as-colimit} every object $Q$ of $D_{\QCoh, T}(\mathcal{O}_Y)$ is a derived colimit of a system $Q_1 \to Q_2 \to Q_3 \to \ldots$ such that the cones of the transition maps are direct sums of shifts of $E$. Arguing by induction we see that $Q_n \in \mathcal{D}$ for all $n$ and finally that $Q$ is in $\mathcal{D}$. Thus the equivalent conditions of (2) hold.
Let $Q \in D^+_\QCoh(\mathcal{O}_Y)$ be supported on $Y \setminus V$. To get a contradiction, assume that $a(Q)$ is not supported on $X \setminus U$. Then we can find a perfect complex $P_U$ on $U$ and a nonzero map $P_U \to a(Q)|_U$ (follows from Derived Categories of Schemes, Theorem \ref{perfect-theorem-bondal-van-den-Bergh}). Then using Derived Categories of Schemes, Lemma \ref{perfect-lemma-lift-map-from-perfect-complex-with-support} we may assume there is a perfect complex $P$ on $X$ and a map $P \to a(Q)$ whose restriction to $U$ is nonzero. By definition of $a$ this map is adjoint to a map $Rf_*P \to Q$. \medskip\noindent The complex $Rf_*P$ is pseudo-coherent. In case (1) this follows from Derived Categories of Schemes, Lemma \ref{perfect-lemma-flat-proper-pseudo-coherent-direct-image-general}. In case (2) this follows from Derived Categories of Schemes, Lemmas \ref{perfect-lemma-direct-image-coherent} and \ref{perfect-lemma-identify-pseudo-coherent-noetherian}. Thus we may apply Derived Categories of Schemes, Lemma \ref{perfect-lemma-map-from-pseudo-coherent-to-complex-with-support} and get a map $I \to \mathcal{O}_Y$ of perfect complexes whose restriction to $V$ is an isomorphism such that the composition $I \otimes^\mathbf{L}_{\mathcal{O}_Y} Rf_*P \to Rf_*P \to Q$ is zero. By Derived Categories of Schemes, Lemma \ref{perfect-lemma-cohomology-base-change} we have $I \otimes^\mathbf{L}_{\mathcal{O}_Y} Rf_*P = Rf_*(Lf^*I \otimes^\mathbf{L}_{\mathcal{O}_X} P)$. We conclude that the composition $$ Lf^*I \otimes^\mathbf{L}_{\mathcal{O}_X} P \to P \to a(Q) $$ is zero. However, the restriction to $U$ is the map $P|_U \to a(Q)|_U$ which we assumed to be nonzero. This contradiction finishes the proof.
Let $K^\vee$ be the ``dual'' to $K$, see Cohomology, Lemma \ref{cohomology-lemma-dual-perfect-complex}. For $M \in D_\QCoh(\mathcal{O}_X)$ we have \begin{align*} \Hom_{D(\mathcal{O}_Y)}(Rf_*M, K \otimes^\mathbf{L}_{\mathcal{O}_Y} L) & = \Hom_{D(\mathcal{O}_Y)}( Rf_*M \otimes^\mathbf{L}_{\mathcal{O}_Y} K^\vee, L) \\ & = \Hom_{D(\mathcal{O}_X)}( M \otimes^\mathbf{L}_{\mathcal{O}_X} Lf^*K^\vee, a(L)) \\ & = \Hom_{D(\mathcal{O}_X)}(M, Lf^*K \otimes^\mathbf{L}_{\mathcal{O}_X} a(L)) \end{align*} Second equality by the definition of $a$ and the projection formula (Cohomology, Lemma \ref{cohomology-lemma-projection-formula-perfect}) or the more general Derived Categories of Schemes, Lemma \ref{perfect-lemma-cohomology-base-change}. Hence the result by the Yoneda lemma.
In this proof we will write $f_*$ for $Rf_*$ and $f^*$ for $Lf^*$, etc, and we will write $\otimes$ for $\otimes^\mathbf{L}_{\mathcal{O}_X}$, etc. Let us write (\ref{equation-compare-with-pullback}) as the composition \begin{align*} f^*K \otimes a(\mathcal{O}_Y) & \to a(f_*(f^*K \otimes a(\mathcal{O}_Y))) \\ & \leftarrow a(K \otimes f_*a(\mathcal{O}_K)) \\ & \to a(K \otimes \mathcal{O}_Y) \\ & \to a(K) \end{align*} Here the first arrow is the unit $\eta_f$, the second arrow is $a$ applied to Cohomology, Equation (\ref{cohomology-equation-projection-formula-map}) which is an isomorphism by Derived Categories of Schemes, Lemma \ref{perfect-lemma-cohomology-base-change}, the third arrow is $a$ applied to $\text{id}_K \otimes \text{Tr}_f$, and the fourth arrow is $a$ applied to the isomorphism $K \otimes \mathcal{O}_Y = K$. The proof of the lemma consists in showing that each of these maps gives rise to a commutative square as in the statement of the lemma. For $\eta_f$ and $\text{Tr}_f$ this is Lemmas \ref{lemma-unit-and-base-change} and \ref{lemma-trace-map-and-base-change}. For the arrow using Cohomology, Equation (\ref{cohomology-equation-projection-formula-map}) this is Cohomology, Remark \ref{cohomology-remark-compatible-with-diagram}. For the multiplication map it is clear. This finishes the proof.
By Lemma \ref{lemma-proper-noetherian} the map (\ref{equation-sheafy}) is an isomorphism for objects of $D_\QCoh^+(\mathcal{O}_Y)$. Hence Lemma \ref{lemma-restriction-compare-with-pullback} tells us the restriction of (\ref{equation-compare-with-pullback}) for $K$ to $f^{-1}(V)$ is the map (\ref{equation-compare-with-pullback}) for $K|_V$ and $f^{-1}(V) \to V$. Thus it suffices to show that the map is an isomorphism when $f$ is the identity morphism. This is clear.
In this proof we will write $f_*$ for $Rf_*$ and $f^*$ for $Lf^*$, etc, and we will write $\otimes$ for $\otimes^\mathbf{L}_{\mathcal{O}_X}$, etc. The composition of the top arrows is adjoint to a map $$ g_*f_*(f^*(g^*K \otimes b(\mathcal{O}_Z)) \otimes a(\mathcal{O}_Y)) \to K $$ The left hand side is equal to $K \otimes g_*f_*(f^*b(\mathcal{O}_Z) \otimes a(\mathcal{O}_Y))$ by Derived Categories of Schemes, Lemma \ref{perfect-lemma-cohomology-base-change} and inspection of the definitions shows the map comes from the map $$ g_*f_*(f^*b(\mathcal{O}_Z) \otimes a(\mathcal{O}_Y)) \xleftarrow{g_*\epsilon} g_*(b(\mathcal{O}_Z) \otimes f_*a(\mathcal{O}_Y)) \xrightarrow{g_*\alpha} g_*(b(\mathcal{O}_Z)) \xrightarrow{\beta} \mathcal{O}_Z $$ tensored with $\text{id}_K$. Here $\epsilon$ is the isomorphism from Derived Categories of Schemes, Lemma \ref{perfect-lemma-cohomology-base-change} and $\beta$ comes from the counit map $g_*b \to \text{id}$. Similarly, the composition of the lower horizontal arrows is adjoint to $\text{id}_K$ tensored with the composition  $$ g_*f_*(f^*b(\mathcal{O}_Z) \otimes a(\mathcal{O}_Y)) \xrightarrow{g_*f_*\delta} g_*f_*(ab(\mathcal{O}_Z)) \xrightarrow{g_*\gamma} g_*(b(\mathcal{O}_Z)) \xrightarrow{\beta} \mathcal{O}_Z $$ where $\gamma$ comes from the counit map $f_*a \to \text{id}$ and $\delta$ is the map whose adjoint is the composition $$ f_*(f^*b(\mathcal{O}_Z) \otimes a(\mathcal{O}_Y)) \xleftarrow{\epsilon} b(\mathcal{O}_Z) \otimes f_*a(\mathcal{O}_Y) \xrightarrow{\alpha} b(\mathcal{O}_Z) $$ By general properties of adjoint functors, adjoint maps, and counits (see Categories, Section \ref{categories-section-adjoint}) we have $\gamma \circ f_*\delta = \alpha \circ \epsilon^{-1}$ as desired.
Let $\mathcal{G}$ be a sheaf of $\mathcal{O}_Z$-modules. Then $$ \Hom_{\mathcal{O}_X}(i_*\mathcal{G}, \mathcal{F}) = \Hom_{i_*\mathcal{O}_Z}(i_*\mathcal{G}, \SheafHom_{\mathcal{O}_X}(i_*\mathcal{O}_Z, \mathcal{F})) = \Hom_{\mathcal{O}_Z}(\mathcal{G}, \SheafHom(\mathcal{O}_Z, \mathcal{F})) $$ The first equality by Modules, Lemma \ref{modules-lemma-adjoint-tensor-restrict} and the second by the fully faithfulness of $i_*$, see Modules, Lemma \ref{modules-lemma-i-star-equivalence}. The description of sections is left to the reader.
This is immediate from the construction of the functor $R\SheafHom(\mathcal{O}_Z, -)$ and the fact that if $\mathcal{K}^\bullet$ is a K-injective complex of $\mathcal{O}_X$-modules, then $\SheafHom(\mathcal{O}_Z, \mathcal{K}^\bullet)$ is a K-injective complex of $\mathcal{O}_Z$-modules, see Derived Categories, Lemma \ref{derived-lemma-adjoint-preserve-K-injectives}.
To explain the parenthetical remark, if $X$ is locally Noetherian, then $i$ is pseudo-coherent by More on Morphisms, Lemma \ref{more-morphisms-lemma-Noetherian-pseudo-coherent}. \medskip\noindent Let $K$ be an object of $D^+_\QCoh(\mathcal{O}_X)$. To prove (1), by Morphisms, Lemma \ref{morphisms-lemma-i-star-equivalence} it suffices to show that $i_*$ applied to $H^n(R\SheafHom(\mathcal{O}_Z, K))$ produces a quasi-coherent module on $X$. By Lemma \ref{lemma-sheaf-with-exact-support-ext} this means we have to show that $R\SheafHom_{\mathcal{O}_X}(i_*\mathcal{O}_Z, K)$ is in $D_\QCoh(\mathcal{O}_X)$. Since $i$ is pseudo-coherent the sheaf $\mathcal{O}_Z$ is a pseudo-coherent $\mathcal{O}_X$-module. Hence the result follows from Derived Categories of Schemes, Lemma \ref{perfect-lemma-quasi-coherence-internal-hom}. \medskip\noindent Assume $X = \Spec(A)$ and $Z = \Spec(B)$ as in (2). Let $I^\bullet$ be a bounded below complex of injective $A$-modules representing an object $K$ of $D^+(A)$. Then we know that $R\Hom(B, K) = \Hom_A(B, I^\bullet)$ viewed as a complex of $B$-modules. Choose a quasi-isomorphism $$ \widetilde{I^\bullet} \longrightarrow \mathcal{I}^\bullet $$ where $\mathcal{I}^\bullet$ is a bounded below complex of injective $\mathcal{O}_X$-modules. It follows from the description of the functor $\SheafHom(\mathcal{O}_Z, -)$ in Lemma \ref{lemma-compute-sheaf-with-exact-support} that there is a map $$ \Hom_A(B, I^\bullet) \longrightarrow \Gamma(Z, \SheafHom(\mathcal{O}_Z, \mathcal{I}^\bullet)) $$ Observe that $\SheafHom(\mathcal{O}_Z, \mathcal{I}^\bullet)$ represents $R\SheafHom(\mathcal{O}_Z, \widetilde{K})$. Applying the universal property of the $\widetilde{\ }$ functor we obtain a map $$ \widetilde{\Hom_A(B, I^\bullet)} \longrightarrow R\SheafHom(\mathcal{O}_Z, \widetilde{K}) $$ in $D(\mathcal{O}_Z)$. We may check that this map is an isomorphism in $D(\mathcal{O}_Z)$ after applying $i_*$. However, once we apply $i_*$ we obtain the isomorphism of Derived Categories of Schemes, Lemma \ref{perfect-lemma-quasi-coherence-internal-hom} via the identification of Lemma \ref{lemma-sheaf-with-exact-support-ext}.
The question is local on $X$, hence we may assume that $X$ is affine. Say $X = \Spec(A)$ and $Z = \Spec(B)$ with $A$ Noetherian and $A \to B$ surjective. In this case, we can apply Lemma \ref{lemma-sheaf-with-exact-support-quasi-coherent} to translate the question into algebra. The corresponding algebra result is a consequence of Dualizing Complexes, Lemma \ref{dualizing-lemma-exact-support-coherent}.