If $G$ is a finite group, and $\phi \in \operatorname{Aut}(G)$ is an automorphism of $G$ that
sends each element $g \in G$ to a conjugate of itself, i.e. there exists an $h_g \in G$ depending on $g$ such that $\phi(g) = h_ggh_g^{-1}$.
sends each subgroup $H \le G$ to a conjugate of itself, i.e. there exists an $h_H\in G$ depending on $H$ such that $\phi(H) = h_HHh_H^{-1}$.
Of course if $\phi$ is inner—that is, there is an element $h_\phi$ depending only on $\phi$ such that $\phi(g) = h_\phi gh_\phi^{-1}$ for all $g \in G$—then $\phi$ clearly satisfies 1. and 2. I was surprised to discover that there finite groups $G$ and non-inner automorphisms $\phi \in \operatorname{Aut}(G)$ for which at least one of 1. or 2. holds.
Are there finite groups $G$ and automorphisms $\phi\in\operatorname{Aut}(G)$ for which both 1. and 2. hold, but $\phi$ is not inner?
Edit: Here is an example of "1. but not 2." It comes from GroupProps, although the language there goes a little over my head, so any errors in recounting it are mine. Consider $\mathbb{Z}/8\mathbb{Z}$ and its automorphism group $(\mathbb{Z}/8\mathbb{Z})^\times$. I will write elements of $\mathbb{Z}/8\mathbb{Z}\rtimes(\mathbb{Z}/8\mathbb{Z})^\times$ as $(g,h)$, e.g. $(4,5)$. The proposed automorphism $\phi$ has $(g,1) \mapsto (g,1)$, $(g,7)\mapsto(g,7)$, but $(g,3)\mapsto(g+4,3)$ and $(g,5) \mapsto(g+4,5)$.
It's not hard to check that $\phi$ is an automorphism, so I'll leave it to you. It also satisfies 1.: $(2,1)$ conjugates $(g,3)$ to $(g+4,3)$, and $(1,1)$ conjugates $(g,5)$ to $(g+4,5)$. I claim that it does not send the subgroup $(0,(\mathbb{Z}/8\mathbb{Z})^\times)$ to a conjugate. If it did, $(h,k)$ conjugates $(0,g)$ to $(h-g\cdot h,g)$, so $h$ must be $0$ or $4$, both of which are fixed under multiplication by $3$ or $5$.
The script below is a GAP-script that should identify the existence of such automorphism $\varphi$ for a given group $G$. Note that I've done this in a hurry, so I can't guarantee the correctness.
The script seems to find such automorphism for
SmallGroup(32,44). In particular, this group is isomorphic to the finitely presented groupwith relators
and the automorphism is given by
Note: the example from GroupProps you mention is
SmallGroup(32,43)in GAP. If we leave out the condition of being subgroup-class-preserving, then the above script indeed finds a non-inner automorphism that is class-preserving, though I haven't checked if it's the same one.Note 2: In On groups with a class-preserving outer automorphism by Brooksbank and Mizuhara, the following is said:
These two non-isomorphic groups would then be
SmallGroup(32,43)andSmallGroup(32,44).