1: \begin{abstract} We prove that the outer automorphism group $Out(G)$ is residually finite when the group $G$ is
2: virtually compact special (in the sense of Haglund and Wise) or when $G$ is isomorphic to the fundamental group of some compact $3$-manifold.
3:
4: To prove these results we characterize commensurating endomorphisms of acylindrically hyperbolic groups.
5: An endomorphism $\phi$ of a group $G$ is said to be commensurating, if for every $g \in G$ some non-zero power of $\phi(g)$ is conjugate to a non-zero power of $g$.
6: Given an acylindrically hyperbolic group $G$, we show that any commensurating endomorphism of $G$ is inner modulo a small perturbation.
7: This generalizes a theorem of Minasyan and Osin, which provided a similar statement in the case when $G$ is relatively hyperbolic. We then use this result
8: to study pointwise inner and normal endomorphisms of acylindrically hyperbolic groups.
9:
10: \end{abstract}
11: