Let $N = ker(\phi)$ and $K = im(\phi)$, then you're asking when, given an exact sequence $1 \to N \to G \to K \to 1$ is trivial.
- First you need the extension to be split, that is, there must exist a morphism $s : K \to G$ such that the composition $\phi \circ s$ is the identity. In this case $G \simeq N \rtimes K$, the semidirect product of $N$ and $K$ : this is the splitting lemma (for non-abelian groups).
- Now you want this semidirect product to be direct; this is true iff $K$ is also normal in $G$, or equivalently that there exists a morphism $G \to N$ which is the identity on $N$.
I don't include proofs here, as they're found in any basic group theory notes.
In fact you can get away with the first condition. Indeed, if there exists a map $p : G \to N$ which is the identity on $N$, then a section of $\phi$ automatically exists and the isomorphism $G \cong \operatorname{im}(\phi) \times \operatorname{ker}(\phi) = K \times N$ holds. The required isomorphism is $(\phi, p) : G \to K \times N$ (it's not hard to check that this is in fact an isomorphism).
Let me denote the affine group of $K^n$ by $A_n(K)$.
If you've shown that $A_n(K)$ is a group, you must understand how composition works. It shouldn't be hard to guess what subgroup of $A_n(K)$ must be isomorphic to $GL_n(K)$; if things in $A_n(K)$ look like $(A, C)$ where $A \in GL_n(K)$, it's most likely the case that $H = \{(A, 0) : A \in GL_n(K)\}$ is isomorphic to $GL_n(K)$. You should be able to verify the map
\begin{align*}
\varphi : H &\to GL_n(K)\\
(A, 0) &\to A
\end{align*}
is an isomorphism (there's almost nothing to it).
The straightforward approach to see if (the subgroup isomorphic to) $GL_n(K)$ is normal in $A_n(K)$ is to conjugate the elements of (the subgroup isomorphic to) $GL_n(K)$ by something in $A_n(K)$ and see if you wind back up in (the subgroup isomorphic to) $GL_n(K)$.
Thus, we pick $(A, C) \in A_n(K)$ and $(B, 0) \in H \cong GL_n(K)$ and compute $(A, C)^{-1}(B, 0)(A, C)$. Let's see what $(A, C)^{-1}(B, 0)(A, C)$ does to $X \in K^n$, working right-to-left:
\begin{align*}
(A, C)^{-1}(B, 0)(A, C)X &= (A,C)^{-1}(B, 0)(AX + C) \\
&= \ldots \\
&= (A^{-1}BA, A^{-1}BC)X.
\end{align*}
But $(A^{-1}BA, A^{-1}BC) \in H$ if and only if $A^{-1}BC = 0$; this certainly doesn't hold for all $(A, C) \in A_n(K)$ (in fact it holds for very few of them: since $A$ and $B$ are invertible...).
Best Answer
The map $f: GL_n(\mathbb{R})\to \{-1,1\}$ given by $f(A) = \mathrm{sign}(\det A)$ is a surjective homomorphism with $\ker f = H$, and so by the first isomorphism theorem, $GL_n({\mathbb{R}})/H\cong \{-1,1\}$.