TITLE: Restriction of Ext sheaves
QUESTION [7 upvotes]: Let $f \colon X \to Y$ be a map of schemes, $\mathcal{F}, \mathcal{G}$ two coherent sheaves on $Y$. I'm interested in conditions which guarantee an isomorphism
$$f^{*} \mathcal{E}xt^i(\mathcal{F}, \mathcal{G}) \cong \mathcal{E}xt^{i}(f^{*} \mathcal{F}, f^{*} \mathcal{G}).$$
I know this is true for $f$ flat by [EGA III.12.3.4]. Moreover it seems to me that this is true for $f$ arbitrary when $\mathcal{F}$ is locally free and $i = 0$, essentially by the argument in [EGA I.0.6.7.6]. I am also able to prove this in some other cases by ad hoc methods, but I could not find a general statement.

What are conditions which guarantee the existence of such an isomorphism? I am also interested in having some counterexamples at hand.

REPLY [6 votes]: In a pretty general situation there is an isomorphism of derived functors 
$$
Lf^* RHom(F,G) \cong RHom(Lf^* F,Lf^*G).
$$
Further you can write down the spectral sequences converging to each side,
(e.g. for the LHS it is quite simple --- $L_q f^* Ext^p(F,G)$, for the RHS
it is more complicated). Now, if $f$ is flat, the both spectral sequences
degenerate in the second term and give you the desired isomorphism. 
The same holds if $F$ is locally free. But the general statement is the above isomorphism of the derived functors.