Is the map $f:S_n \to A_{n+2}$ a homomorphism where $f(s)=s$ when $s$ is even and $f(s)=s \circ (n+1,\ n+2)$ when $s$ is odd? Is the map $f:S_n \to A_{n+2}$ given by 
$$f(s)= \begin{cases}
s & s\ \text{is even}\\ 
s \circ (n+1,\ n+2) & s\ \text{is odd}
\end{cases}$$ 
an injective homomorphism? I can show that if it is a homomorphism then it is injective but having difficulty in showing that $f$ is a homomorphism. Please help.  
 A: A map $f : S_n \to A_{n+2}$ is a homomorphism if $f(\sigma\circ\tau) = f(\sigma)\circ f(\tau)$ for every $\sigma, \tau \in S_n$. As $f$ is defined piecewise, we split this verification into cases.


*

*Both $\sigma$ and $\tau$ are even. Note that $\sigma\circ\tau$ is even so 


$$f(\sigma\circ\tau) = \sigma\circ\tau = f(\sigma)\circ f(\tau).$$


*Both $\sigma$ and $\tau$ are odd. Note that $\sigma\circ\tau$ is even so


\begin{align*}
f(\sigma\circ\tau) &= \sigma\circ\tau\\ 
&= \sigma\circ\tau\circ(n+1, n+2)\circ (n+1, n+2)\\ 
&= \sigma\circ(n+1, n+2)\circ\tau\circ(n+1, n+2)\\ 
&= f(\sigma)\circ f(\tau).
\end{align*}


*$\sigma$ is even and $\tau$ is odd. Note that $\sigma\circ\tau$ is odd so


$$f(\sigma\circ\tau) = \sigma\circ\tau\circ(n+1, n+2) = f(\sigma)\circ f(\tau).$$


*$\sigma$ is odd and $\tau$ is even. Note that $\sigma\circ\tau$ is odd so


$$f(\sigma\circ\tau) = \sigma\circ\tau\circ(n+1, n+2) = \sigma\circ(n+1, n+2)\circ\tau = f(\sigma)\circ f(\tau).$$
So, for any $\sigma, \tau \in S_n$, $f(\sigma\circ\tau) = f(\sigma)\circ f(\tau)$, so $f$ is a homomorphism.
A: As disjoint cycles commute and $\;(n+1\;n+2)^2=1\;$ , for any two cycles $\;\sigma,\pi\in S_n\;$ we get
$$f(\sigma\pi):=\begin{cases}\sigma\pi&,\text{both cycles have same parity}\\{}\\\sigma\pi(n+1\;n+2)=\sigma(n+1\;n+2)\pi=f(\sigma)f(\pi)&,\text{otherwise}\end{cases}$$
where $\;\sigma\;$ odd (first) case and $\;\pi\;$ even, and the other way around in the second case.
Now generalize using that any permutation is the product of disjoint cycles.
A: One more way to think about it:
Conceive of your map $f$ as actually being from $S_n$ to $S_{n+2}$. The image lies in the subgroup $S_n\times S_2$ consisting of permutations that act independently on the first $n$ and the last $2$ indices. You can see your map as being the identity map to the first factor ($S_n$), and exactly the sign homomorphism to the second factor ($S_2$). Therefore it is a direct product of homomorphisms, so it is a homomorphism.
It happens (because of how you constructed it) that the image lies inside $A_{n+2}$, so it's a homomorphism of $S_n$ into $A_{n+2}$.
