Let $X$ be a topological space, $\mathcal I$ some injective sheaf of abelian groups on $X$ and let $U \subset X$ be open. Is $\mathcal I(U)$ an injective abelian group?
If not what requirements would we need to make this so (eg. perhaps requirements on the space $X$ or the choice of open set $U$)?
What about if $X$ was a scheme (or just a locally ringed space) and $\mathcal I$ an injective sheaf of $\mathcal O_X$-modules, is $\mathcal I(U)$ an injective $\mathcal O_X(U)$-module? Again if not what requirements would we need to make this so?
(My main question is the one in the title so I don't mind partial answers to any of these slightly separate questions).
In general, if $(F,G)$ is a pair of adjoint functor and if $F$ is exact, then $G$ preserve injectives. Indeed, if $I$ is injective, then the functor $Hom(F(.),I)$ is exact as a composite of $F$ (exact by assumption) and $Hom(.,I)$ (exact because $I$ is injective). But $Hom(F(.),I)=Hom(.,G(I))$, so $Hom(.,G(I))$ is exact which means that $G(I)$ is injective.
In your particular case, you consider the functor $\Gamma(U,.)$ whose left adjoint is $A\mapsto {j_U}_!\underline{A}$ where $\underline{A}$ is the constant sheaf on $U$ with stalks $A$, and ${j_U}_!$ is the extension by zero outside of $U$. This is an exact functor (as a composite of exact functors). This implies that $\Gamma(U,.)$ preserve injectives.
Hence, if $\mathcal{I}$ is an injective sheaf, then for all open $U\subset X$, $\mathcal{I}(U)$ is injective.
This does not change anything if you consider categories of $\mathcal{O}_X$-modules and $\mathcal{O}_X(U)$-modules.