I try to show that $A_n \times \mathbb{Z} /2 \mathbb{Z} \ \ncong \ S_n$ for $n \geq 3$.
It is not hard to show the statement for $n=3$.
We have $$ A_3 \times \mathbb{Z} /2 \mathbb{Z} \ \cong \ \mathbb{Z} /3 \mathbb{Z} \times \mathbb{Z} /2 \mathbb{Z} \ \cong \ \mathbb{Z} /6 \mathbb{Z} $$ an abalian group, while $(123)(12) = (13) \neq (23)= (12)(123)$ shows that $S_3$ is not abelian.
Here I try to solve the exercise in general. I guess that the only homomorphism
$$
\phi \quad : \quad A_n \times \mathbb{Z}/2\mathbb{Z} \longrightarrow S_n
$$
can be made my mapping $(\sigma,1) \mapsto \sigma$ and $(\sigma,-1) \mapsto (\tau \sigma)$ for some odd permutation $\tau$. I don't know how I could prove that. Please give me a hint to go on.
In case $S_n=\mathbb{Z}/2\mathbb{Z} \times A_n$, we have $S_n=NA_n$, with $\mathbb{Z}/2\mathbb{Z} \cong N \lhd S_n$, $N \cap A_n=1$. Since $S_{n}'=[S_n,S_n]=A_n$ and $N \cap A_n=1$, we have $N \subseteq Z(S_n)=\{(1)\}$, a contradiction (in general, if $N \lhd G$ and $N \cap G'=1$, then $N \subseteq Z(G)$).
Yet another way of obtaining a contradiction: take the centers at both sides and use that $Z(A_3)=A_3$ and $Z(A_n)=\{(1)\}$ for $n \gt 3$: $$Z(A_n \times \mathbb{Z}/2\mathbb{Z})=Z(A_n) \times \mathbb{Z}/2\mathbb{Z} \cong \mathbb{Z}/2\mathbb{Z}, $$ while $Z(S_n)=\{(1)\}$.