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.