When does the direct image functor commute with tensor products? Let $i : U \to X$ be a quasi-compact open immersion of schemes. Under which conditions is the natural map
$i_* M \otimes i_* N \to i_* (M \otimes N)$
for all $M,N \in \text{Qcoh}(U)$ an isomorphism? We may assume that $X=\text{Spec}(A)$ is affine. If $U$ is affine, then we may reduce to the case $M=N=\mathcal{O}_U$ (using presentations) and use that $i^{\#}$ is a flat epimiorphism to get an affirmative answer. If there are counterexamples for general $U$, what conditions are sufficient?
 A: Here's a counterexample: over a field $k$, let $X=\mathbb{A}^4=\mathbb{A}^2\times \mathbb{A}^2$, and $U$ the complement of the origin. Put $Y=\mathbb{A}^2\times\{0\}$, $Z=\{0\}\times\mathbb{A}^2$, $Z'=Z\cap U$, $Y'=Y\cap U$. 
Take $M=\mathcal{O}_{Y'}$ and  $N=\mathcal{O}_{Z'}$. Then $M\otimes N$ is zero, while $ i_* M=\mathcal{O}_{Y}$ and $i_* N=\mathcal{O}_{Z}$, so $i_* M\otimes i_* N$ is the structure sheaf of the origin.
A: This is an addition to the Laurent's answer. First, it should be said that if one derives all the functors, one will get an isomorphim --- $Ri_*M \otimes^L Ri_*N \cong Ri_* (M \otimes^L N)$. Indeed, it is a simple corollary of the projection formula:
$$
Ri_*M \otimes^L Ri_*N \cong
Ri_*(M \otimes^L i^*Ri_*N) \cong
Ri_*(M \otimes^L N)
$$
(the second isomorphism is by the flat base change). What goes wrong with the underived version is that $M$ and $N$ have higher direct images which then have $Tor$'s all of which eventually get canceled. In the particular example of Laurent one has 
$$
R^1i_*O_{Y'} = y_1^{-1}y_2^{-1}k[y_1^{-1},y_2^{-1}],
\quad
R^1i_*O_{Z'} = z_1^{-1}z_2^{-1}k[z_1^{-1},z_2^{-1}],
$$ 
where are $y_1,y_2$ are coordinates on $Y$ and $z_1,z_2$ are coordinates on $Z$. 
In addition to $O_Y\otimes O_Z = k$ we have 
$$
Tor_2(O_Y,R^1i_*O_{Z'}) = Tor_2(R^1i_*O_{Y'},O_Z) = k,
$$
$$
Tor_4(R^1i_*O_{Y'},R^1i_*O_{Z'}) = k,
$$ 
and it is easy to see that all this cancels in the spectral sequence calculating $Ri_*O_{Y'} \otimes^L Ri_*O_{Z'}$.  
