For a group $G$, let $\operatorname{Aut}(G)$ denote the group of all automorphisms of $G$ and $\operatorname{Inn}(G)$ denote the subgroup of all autmorphisms which is of the form $f_h(g)=hgh^{-1}, \forall g\in G$, where $h\in G$ . Now if $G_1$ is a group containing $G$ as a subgroup then every $f_h \in \operatorname{Inn}(G)$ extends to an inner automorphism of $G'$ as $f_h(x)=hxh^{-1},\forall x\in G_1$, so in other words, for every $f\in \operatorname{Inn} (G)$ and every group $G_1$ containing $G$ as a subgroup, $\exists \bar f\in \operatorname{Inn}(G_1) \subseteq \operatorname{Aut} (G_1)$ such that $\bar f|_G =f$.
Now my question is : Let $f \in \operatorname{Aut} (G)$ be such that for every group $G_1$ containing $G$ as a subgroup, $\exists \bar f\in \operatorname{Aut}(G_1)$ such that $\bar f|_G =f$. Then is it necessarily true that $f \in \operatorname{Inn}(G)$ ? If this is not true in general, then does some extra condition on $G$ makes it true (like $G$ being finite, or simple)?
How about this: A Characterization of Inner Automorphisms Paul E. Schupp Proceedings of the American Mathematical Society Vol. 101, No. 2 (Oct., 1987), pp. 226-228
https://www.jstor.org/stable/2045986?seq=1#page_scan_tab_contents
Abstract: It turns out that one can characterize inner automorphisms without mentioning either conjugation or specific elements. We prove the following
THEOREM Let $G$ be a group and let $\alpha$ an automorphism of $G$. The automorphism $\alpha$ is an inner automorphism of $G$ if and only if $\alpha$ has the property that whenever $G$ is embedded in a group $H$, then $\alpha$ extends to some automorphism of $H$.