Injective $\mathcal{O}_X$ module is flasque This is a lemma from Hartshorne. 

Let $(X,\mathcal{O}_X)$ be a ringed space. Then any injective $\mathcal{O}_X$ module is flasque.

I am trying to prove this. Let $V\subseteq U$ be open subsets of $X$, we need to prove that the restriction map $\mathcal{F}(U)\rightarrow \mathcal{F}(V)$ is surjective morphism.
As $\mathcal{F}$ is an injective module, any injective morphism of sheaves $0\rightarrow \mathcal{A}\rightarrow \mathcal{B}$ gives a surjective morphism $\text{Hom}(\mathcal{B},\mathcal{F})\rightarrow \text{Hom}(\mathcal{A},\mathcal{F})\rightarrow 0$.
So, it is natural to look for  sheaves of $\mathcal{O}_X$ modules $\mathcal{A},\mathcal{B}$ such that $$\text{Hom}(\mathcal{B},\mathcal{F})=\mathcal{F}(U) \text{ and }\text{Hom}(\mathcal{A},\mathcal{F})=\mathcal{F}(V).$$
Hartshorne gave $\mathcal{B}=j_!\left(\mathcal{O}_X|_U\right)$ and $\mathcal{A}=j_!\left(\mathcal{O}_X|_V\right)$ and then says that $$\text{Hom}(\mathcal{B},\mathcal{F})=\mathcal{F}(U) \text{ and }\text{Hom}(\mathcal{A},\mathcal{F})=\mathcal{F}(V).$$
But, how did they come up with that example. How on earth can one guess such example. Any motivation regarding this is welcome.
Coming to the proof of $$\text{Hom}(j|!\left(\mathcal{O}_X|_U\right),\mathcal{F})\cong \mathcal{F}(U).$$
Let $s\in \mathcal{F}(U)$, we construct a morphism of $\mathcal{O}_X$ modules 
$j_!\left(\mathcal{O}_X|_U\right)\rightarrow \mathcal{F}$. Let $W\subseteq X$ be open. If $W\nsubseteq U$ then $j_!\left(\mathcal{O}_X|_U\right)(W)=\emptyset$. So, with out loss of generality, we assume $W\subseteq U$.
So, we define $\eta(W):j_!\left(\mathcal{O}_X|_U\right)(W)\rightarrow \mathcal{F}(W)$ i.e., $\eta(W):\mathcal{F}(W)\rightarrow \mathcal{F}(W)$. Let $t\in \mathcal{F}(W)$ then assign $t\cdot s|_W\in \mathcal{F}(W)$ to $t$. This collection gives a morphism of $\mathcal{O}_X$ modules.
Let $\eta:j_!\left(\mathcal{O}_X|_U\right)\rightarrow \mathcal{F}$ be a morphism of sheaves of $\mathcal{O}_X$ modules. We need to assign an element of $\mathcal{F}(U)$ with this. $\eta$ comes with maps $\eta(W):j_!\left(\mathcal{O}_X|_U\right)(W)\rightarrow \mathcal{F}(W)$ for each $W\subseteq U$. To get an element of $\mathcal{F}(U)$ its only natural to consider $\eta(U):j_!\left(\mathcal{O}_X|_U\right)(U)\rightarrow \mathcal{F}(U)$ i.e., $\eta(U):\mathcal{F}(U)\rightarrow \mathcal{F}(U)$. We have $\eta(U)(1)\in \mathcal{F}(U)$ an element of $\mathcal{F}(U)$. 
I am almost sure that this is an isomorphism. Any suggestion on better proof is welcome. Any suggestion on how they come up with that example is welcome.
 A: There are several mistakes in your proof, but these are just technical, and you've the right idea.
First, this is not true that $j_!\mathcal{F}(V)=\emptyset$ if $V\not\subset U$. Well, if anything, it should be $0$ instead of $\emptyset$ since we are talking of $\mathcal{O}_X$-modules. But in fact, it might not be $0$. The sheaf $j_!\mathcal{F}$ is defined to be the sheaf associated to the presheaf
$$ j_p\mathcal{F}:V\mapsto\left\{\begin{array}{ll}\mathcal{F}(U) & \text{if $V\subset U$}\\ 0 & \text{if $V\not\subset U$}\end{array} \right. $$
It does not change your proof, since from the universal property of the associated sheaf, you only need to construct an isomorphism $\operatorname{Hom}_{PSh(X,\mathcal{O}_X)}(j_p\mathcal{O}_X|_U,\mathcal{F})\simeq\mathcal{F}(U)$.
Then, I don't know if this is a typo or a confusion, but you wrote (twice) that maps $j_!\mathcal{O}_{X}|_{U}(V)\rightarrow\mathcal{F}(V)$ correspond to maps $\mathcal{F}(V)\rightarrow\mathcal{F}(V)$. They correspond to maps $\mathcal{O}_X(V)\rightarrow\mathcal{F}(V)$ of course. It doesn't change the rest your argument though (in fact, it makes it correct).
So now, you just need to show that the maps you constructed are inverse to each other. This is easy, I let you write the details.

Now let me explained how one comes up to this construction. It is worth knowing the following facts :


*

*$\operatorname{Hom}_{\mathcal{O}_X}(\mathcal{O}_X,\mathcal{F})=\mathcal{F}(X)$. This is a sheaf-theoretic version of the isomorphism $\operatorname{Hom}_A(A,M)=M$ if $A$ is any ring and $M$ any $A$-module.

*$\mathcal{O}_X|_U=\mathcal{O}_U$ (if $X$ is a scheme). More is true : if $\mathcal{F}$ is any $\mathcal{O}_X$-module, $\mathcal{F}|_{U}:=j^{-1}\mathcal{F}$ is already an $\mathcal{O}_U$-module and $\mathcal{F}|_U=j^*\mathcal{F}$.

*The functor $j_!:\operatorname{Sh}(U,\mathbb{Z})\rightarrow\operatorname{Sh}(X,\mathbb{Z})$ is the left adjoint to $j^{-1}$. If moreover $X$ (and hence $U$) is a scheme, then for every $\mathcal{O}_U$-module $\mathcal{F}$, the sheaf $j_!\mathcal{F}$ is an $\mathcal{O}_X$-module and the functor $j_!$ is the left adjoint of $j^*:\mathcal{O}_X-mod\rightarrow\mathcal{O}_U-mod$.
Using these fact you get 
$$\operatorname{Hom}_{\mathcal{O}_X}(j_!\mathcal{O}_X|_U,\mathcal{F})=\operatorname{Hom}_{\mathcal{O}_U}(\mathcal{O}_U,\mathcal{F}|_U)=\mathcal{F}(U)$$
Of course, to prove these three facts, you need to do something very similar to what you have done, so this does not simplify the proof in any way, but may just gives some insight of what is going on.
Finally, there is a fourth fact which is worth knowing, giving another point of view on $j_!\mathcal{O}_U$ :


*

*The object $j_!\mathcal{O}_U$ is the free $\mathcal{O}_U$-module on the representable sheaf $\underline{U}$. Using Yoneda lemma, you can know prove it this way :


$$\operatorname{Hom}_{\mathcal{O}_X}(j_!\mathcal{O}_X|_U,\mathcal{F})=\operatorname{Hom}_{\operatorname{Sh}(X)}(\underline{U},\mathcal{F})=\mathcal{F}(U)$$
In the end, the equality $\operatorname{Hom}_{\mathcal{O}_X}(j_!\mathcal{O}_X|_U,\mathcal{F})=\mathcal{F}(U)$ is not so surprising, and even if it is still a bit mysterious now (it won't stay that way long), this equality is quite important.
