I want to know if the follow is true and if this is true, prove it.

Let $X$ be a variety and let $Z\subset X$ be a subvariety of $X$. If $\mathcal F$ is a coherent sheaf then $H^i(Z,\mathcal F|_Z)=H^i(X,\mathcal F)$

In Hartshorne's book the lemma III.2.10 said that $H^i(Z,\mathcal G)=H^i(X,j_*\mathcal G)$; where $j: Z\hookrightarrow X$ is the inclusion, $\mathcal G$ is a sheaf of abelian groups on $Z$ and $j_*$ is the extension of $\mathcal G$ by zero outside $Z$.

My first idea is to take $\mathcal G:=j^*\mathcal F$ and by the natural map $\mathcal F\mapsto i_*i^*\mathcal F$ , then I think that my proposition is true $H^i(Z,\mathcal F|_Z)=H^i(X,\mathcal F)$. But I don't really know how to write that in details and if it is totally true.

I appreciate any help to prove my claim.


This is false: take $X=\Bbb P^1_k$, $Z$ a closed point, and $\mathcal{F}=\mathcal{O}_X(-2)$. Then $H^1(X,\mathcal{F})=k$, but all sheaves of abelian groups on $Z$ have vanishing $H^1$.