TITLE: "PushPull" of a locally free sheaf
QUESTION [6 upvotes]: Let $F \to Y$ be a locally free sheaf over $X$, and $\pi:X\to Y$. Is it true that
$$ \pi_*\pi^{-1}F = F \quad ? $$
This seems obvious to me, but I'm asking here because I'm often wrong with these things ;-)
My way to prove the above claim is simply to consider an affine open $V\subset Y$ and compute
$$ \pi_*\pi^{-1}F(V) = \pi^{-1}F(\pi^{-1}V) = \lim_{W\supset V}F(W) = F(V) $$
This really looks correct to me. In case it is wrong, could you point out which is the step that goes wrong?
Bonus question: What about the case of a quasichoerent sheaf on a scheme? Is it true that $$\pi_* \pi^* F = F \quad ?$$

REPLY [4 votes]: The second formula you quote is true in the following case:

$Z \overset{\pi}\to X$ is a closed immersion with $Z\,$ equal to the support of a coherent sheaf $\mathcal{F}$ on $X$. 

Here is a proof of this fact. We may assume that $X$ is affine (equal to $\operatorname{Spec} A$) with $\mathcal{F} = \widetilde{M}$ for some finite type $A$-module $M$. Hence $\pi$ is the closed immersion $\operatorname{Spec}(A/\operatorname{Ann}(M)) \to \operatorname{Spec} A$.
Now we have  $\pi_{\ast} \pi^\ast \widetilde{M} = \hspace{1mm}_A(M \otimes_A A/\operatorname{Ann}(M))$ which is canonically isomorphic to $M$ as an $A$-module because $M$ is canonically an $A/\operatorname{Ann}(M)$-module. This concludes the proof.