By a $\mathbb{Z}_2$ extension of $A_n$, I mean the following short exact sequence:
$1 \longrightarrow A_n \longrightarrow G \longrightarrow \mathbb{Z}_2 \longrightarrow 1$.
Question: How many $G$ are there up to isomorphism?
Note: One can check that if the above S.E.S. splits then there are only two choices of $G= S_n$ or $ A_n\times\mathbb{Z}_2$, up to isomorphism, since $\mathrm{Out}(A_n)=\mathbb{Z}_2$. But I'm not able to show that the above S.E.S. always splits i.e. there is no non-split group extension of $A_n$ by $\mathbb{Z}_2$.
Let $G$ be such an extension. If the centralizer of $A_n$ in $G$ is nontrivial then, since $A_n$ has trivial centre, this centralizer must have order $2$ and it would be a normal subgroup giving $G \cong A_n \times C_2$.
Otherwise the centralizer is trivial, in which case conjugation induces an injective homomorphism $G \to S_n$, and so $G \cong S_n$, which is a split extension.
Added later: Note that the above is true only when $n \ne 6$. When $n=6$ there are four extensions of this type, three of which are split and one nonsplit.