Restriction of sheaf Suppose $X$ is a smooth variety and $F$ is a locally free sheaf on $X$. Let $U$ be an open subset of $X$ and $i$ denote the inclusion map.
Is $i_*i^*F$ equal to $F$?
 A: No. For example, let $X = P^1$, $U = A^1$ and $F = O_X$. Then $i^*F = O_U$ and the global sections of $i^*F$ is the algebra of polynomials $k[t]$. Therefore $\Gamma(X,i_*i^*F) = \Gamma(U,i^*F) = k[t]$, while $\Gamma(X,F) = k$.
A: This is true if and only if the complement of $U$ has codimension at least $2$.
To see that this condition is sufficient see this MO answer.
To see that it is necessary, see Sasha's example, or take any $X$ and any Cartier divisor $D$ on $X$ and note that for $U=X\setminus \operatorname{Supp}D$, $i^*\mathscr O_X(mD)\simeq \mathscr O_U\simeq i^*\mathscr O_X(nD)$ for any $m,n\in \mathbb Z$, so $i_*i^*F$ can't be $F$ for both choices.
Remark for the codimension $2$ condition, you don't actually need smoothness. See the linked answer for more.
A: In general, we have the socalled projection formula: if $f:X\to Y$ is a morphism of ringed spaces, $\mathcal F$ an $\mathcal O_X$-module, and $E$ be a locally-free $\mathcal O_Y$ module of finite rank, then $f_* (\mathcal F \otimes f^{*} E) \simeq f_{*}\mathcal F \otimes E$.
Edit (following Will's remark): The projection formula yields in the case of an open immersion $i:U \subset X$ the following identity : $i_* i^* F \simeq i_*\mathcal O_U \otimes F$. Therefore, if $U$ has codimension at least 2 in $X$, then $i_* i^* F\simeq F$ by normality of $X$.
