Restriction of Ext sheaves 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.

 A: Hi Andrea, I don't think one can prove much without flatness. Let's assume the simplest case, that $X=\text{Spec}(S)$, $Y= \text{Spec}(R)$, and $R\to S$ is a finite local homomorphism with $R$ regular. Then I claim what you want is equivalent to flatness. 
Your condition amounts to
$$\text{Ext}_R^i(M,N)\otimes_RS \cong \text{Ext}_S^i(M\otimes S,N\otimes S)$$
for  $R$-modules $M,N$. There is a well-known result that the first $i$ such that $\text{Ext}_R^i(R/I,R)\neq 0$ is the length of the longest $R$-regular sequence in $I$. Let $M=R/m_R$, $N=R$, then by the Ext condition we can conclude that $m_RS$ contains a $S$-regular sequence of length equals to $\text{dim}\ S$. So $S$ is Cohen-Macaulay. 
But then "miracle flatness" implies that $f$ is flat! This also provides counter-examples: if $S$ is not Cohen-Macaulay, choose $i$ to be $\text{depth}\ S$. 
ADDED: for the sake of completeness, here is a class of examples to show the second nice situation ($\mathcal F$ is locally free) can't be generalized to much.
Let $Y=\mathbb A^n$, $X=V(f)\subset Y$ such that $f$ vanishes at the origin. Let $\mathcal F$ be locally free on $Y$ minus the origin, but not free at the origin. Let $\mathcal G$ be any torsion-free coherent sheaf on $Y$. Then I claim the condition you want (let's call it $(*)$) will not hold.
From the short exact sequence $0\to \mathcal G \to \mathcal G \to \mathcal G/(f)\to 0$ (the first map is multiplication by $f$, exact because $\mathcal G$ is torsion-free) one can take  $\mathcal Hom(\mathcal F,-)$ to get a long exact sequence. Looking at such l.e.s,  $(*)$ means precisely that the maps by multiplication by $f$:
$$\mathcal Ext^i(\mathcal F,\mathcal G) \to \mathcal Ext^i(\mathcal F,\mathcal G) $$
must be injective for all $i>0$. But as all these ${\mathcal Ext}$ vanish away from the origin and $f$ vanishes at the origin, 
they have to be $0$. Now localize at the origin, take a minimal free resolution of the stalk of $\mathcal F$ to compute Ext and  use Nakayama, one can show that $\mathcal F$ must also be free there, contradiction.
A: 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.
