Extension of $\mathbb Z_2$ by $SO(n)$ How to show that the extension of group $\mathbb Z_{2}$ by $\operatorname{SO}(n)$:
$$\operatorname{Id} \to \operatorname{SO}(n) \to \operatorname{O}(n) \xrightarrow{\det} \mathbb Z_2 \to 1$$
is a direct product for odd $n$ and semidirect product for even $n$ ?
 A: Such a short exact sequence splits if and only if you can find a group morphism :
$$\phi: \mathbb{Z}_2\rightarrow O(n)$$
With the condition that $det\circ \phi$ is the identity of $\mathbb{Z}_2$. In the following I will denote $\mathbb{Z}_2=\{\pm 1\}$ multiplicatively (it is more coherent with the determinant).
Since $\mathbb{Z}_2$ is a very small group, in order to define properly $\phi$ you just need to send $1$ (the neutral element) to the identity matrix and $-1$ to some matrix $A$. We need :
$$A\text{ to be in } O(n)\text{ of order }2\text{ so that } \phi\text{ is a group morphism.} $$
$$det(A)=-1\text{ so that we do have a section, i.e. we have the relation }det\circ\phi=Id $$
When you have $n$ odd you now that $det(-I_n)=-1$, since it is clear that $(-I_n)^2=I_n$, $A:=-I_n$ is clearly what we are looking for. Furthermore, since $-I_n$ is central, it is clear that not only we have :
$$O(n)=SO(n)\rtimes \langle -I_n\rangle $$
But we actually have a direct product :
$$O(n)=SO(n)\times \langle -I_n\rangle $$
In the case $n$ even, we cannot choose $A:=-I_n$ anymore since $det(-I_n)=1$. Anyway you may choose the following matrix :
$$A:=\begin{pmatrix}-1&&&\\&1&&\\&&\ddots&\\&&&1\end{pmatrix}$$
Then you have :
$$O(n)=SO(n)\rtimes \langle A\rangle $$
Finally, if you wanted to show that no $A$ can be chosen so that it gives a direct product, it is easy, if it were the case then the center of $O(n)$ would be of order $4$ (isomorphic to $\{\pm I_n\}\times \langle A\rangle$),
but it is easy to prove that $Z(O(n))=\{\pm I_n\}$ 
