Relationship between index $n$ subgroups and homomorphisms onto $\mathbb Z/ n \mathbb Z$ I've been having a think about the relationship between index $n$ subgroups of a group $G$ and homomorphisms $G \to \mathbb Z / n \mathbb Z$. 

Let's first have a look at the case $n = 2$. 
i) Suppose we have a non-trivial homomorphism $\phi : G \to \mathbb Z / 2 \mathbb Z $, where $G$ is a group. Then $H = \mathrm{ker}\phi$ is a normal subgroup of $G$. Since $\phi$ is non-trivial, $G/H \cong \mathbb Z / 2 \mathbb Z$ and we have that $H$ is a normal subgroup of index $2$ in $G$. So every non-trivial homomorphism $\phi$ gives rise to an index $2$ subgroup $\mathrm{ker}\phi$. 
ii) Suppose $H$ is a subgroup of index $2$ in $G$. Then $H$ is necessarily normal and not equal to $G$. It seems natural to define $\phi : G \to \mathbb Z / 2 \mathbb Z$ by $\phi(H) = 0$, $\phi(G \backslash H) = 1$. This is necessarily a homomorphism, since the product of two elements in $G \backslash H$ must be in $H$ (using normality of $H$). So every index $2$ subgroup gives rise to a non-trivial homomorphism, and the required correspondence is established.

Let's see what happens when we try to generalise this method for higher $n$. 
If $n = 3$, any non-trivial homomorphism $\phi : G \to \mathbb Z / 3 \mathbb Z$ must be surjective, and so the argument used in i) still works; every non-trivial homomorphism $\phi$ gives rise to an index $3$ subgroup $\mathrm{ker}\phi$.
I then come across two problems:


*

*I can't seem to generalise i) for $n$ higher than $3$, since I can't guarantee surjectivity. EDIT: I can guarantee surjectivity if $n$ is prime, though (since non-triviality implies the existence of a $g \in G$ with $\phi(g) = a \neq 0$, and $n$ prime implies the existence of a multiplicative inverse of $a \ (\mathrm{mod } \ n )$). 

*I can't even generalise my argument in ii) to the case when $n = 3 $, since normality was key here.
I suppose what I'd like to know is:
A) Is there a nice generalisation of the $n=2$ result? Does it use the same method and, if so, why haven't I managed to get it to work?
B) Is there some other approach to this problem / explanation of why no such approach exists? Perhaps it might be helpful to decompose $\mathbb Z / n \mathbb Z$ according to the prime factorisation of $n$? 
C) Is there anything else relevant to the problem that I haven't thought about? I can see complications may arise in the case where $G$ is not finite.
Thanks.
 A: The general statement of what you're heading toward is...

$G$ has a normal subgroup of prime index $p$ if and only if there exists a non-zero homomorphism from $G$ to $\mathbb{Z}_p$.
Proof: Suppose $H$ is a normal subgroup of index $p$. Then $G/H$ is a subgroup of order $p$. Thus it's isomorphic to $\mathbb{Z}_p$ since $p$ is prime: call this isomorphism $\varphi$. Let $\pi:G \to G/H$ be the projection homomorphism $\pi(g)=gH$. Then $\varphi \circ \pi$ is a non-zero homomorphism from $G$ to $\mathbb{Z}_p$.
Now suppose there is a non-zero homomorphism. Since any non-zero element of $\mathbb{Z}_p$ generates the group, this homomorphism is onto and so by the isomorphsm theorem $G/\mathrm{Ker}$ is isomorphic to $\mathbb{Z}_p$ which implies that the kernel (a normal subgroup) has index $p$.

Now if there is a surjective homomorphism onto $\mathbb{Z}_n$ then one has a normal subgroup of index $n$ (by the isomorphism theorem). However, if one has a normal subgroup of index $n$ (not nec. prime), then there is a surjective homomorphism onto a group of order $n$, but in general this group doesn't have to be cyclic (or even abelian).
Now if you want to probe subgroups of index $n$ which are not necessarily normal, your line of inquiry probably won't pan out -- because you're essentially looking at kernels (which are always normal). To look at subgroups (not nec. normal), group actions are the way to go.
We say $G$ acts on a set $S$ if there is a map $\cdot:G \times S \to S$ denoted $(g,s) \mapsto g \cdot s$ such that $(gh)\cdot s = g \cdot (h \cdot s)$ for all $g,h \in G$ and $s \in S$ and also $e \cdot s= s$ for all $s \in S$ if $e$ is the identity of $G$.
Let $s \in S$. Then $G \cdot s = \{ g \cdot x \;|\; g \in G\}$ is the orbit of $s$ and $G_s = \{ g \in G \;|\; g \cdot s = s \}$ is the isotropy subgroup fixing $s$ (or stabilizer of $s$). It's not hard to show that isotropy subgroups are in fact subgroups and the orbits of elements partition the set being acted upon. It can be shown that $[G:G_s]=|G \cdot s|$ (sort of a generalization of Lagrange's theorem), so the size of the orbit of $s$ times the size of the stabilizers of $s$ equals the size of the group.
Now suppose $H$ is a subgroup of $G$ of index $n$, then $G$ acts transitively on the left cosets of $H$ in $G$ (which is a set with $n$ elements): $g \cdot xH = (gx)H$. [Transitive means that there is only 1 orbit.]
Conversely, if $G$ acts transitively on a set of size $n$ then any isotropy subgroup (stabilizer) is a subgroup of index $n$ since the index of an isotropy subgroup fixing $x$ is equal to the size of the orbit of $x$ which is everything (i.e. $n$ elements) if we assume the action is transitive.
A: There are several ways of generalizing some or all of the observations you make. The reason you are getting a bit lost is the perhaps unfortunately coincidence that $S_2$, the group of all permutations on the set of two elements, is the same as $\mathbf{Z}_2$, the cyclic group of order $2$; this lead to an attempt to generalize along cyclic groups rather than permutation groups.
Bill Cook has given the standard generalization: 

A group $G$ has a subgroup $H$ of index $n$ if and only if there is a homomorphism of $G$ onto a transitive subgroup of $S_n$. Moreover, the homomorphism can be chosen so that the kernel of the homomorphism is contained in $H$.  

Another line of generalization runs along the observation that a subgroup of index $2$ must necessarily be a normal subgroup. A standard generalization is:

Let $G$ be a finite group. If $H$ is a subgroup of $G$, and $[G:H]$ is the smallest prime that divides $|G|$, then $H\triangleleft G$.

The proof is very different from the proof for the case $[G:H]=2$, but this theorem has the $[G:H]=2$ case as a special case. It uses group actions:
Proof. Since $[G:H]=p$, then there is a homomorphism $G\to S_p$. The kernel of the homomorphism is contained in $H$; let $N$ be the kernel. Then $[G:N]$ divides $|S_p|=p!$ by Lagrange's Theorem. But the smallest prime that divides $|G|$ is $p$, so $[G:N]$ cannot be divisible by any prime smaller than $p$. Therefore, $[G:N]=p$, and since $N\subseteq H$ we conclude that $N=H$. Thus, $H\triangleleft G$, as claimed. $\Box$. 
Another generalization is a simple observation:

A group $G$ has a normal subgroup of index $n$ if and only if there is a onto homomorphism from $G$ onto a group of order $n$.

Proof. If $K$ is a group of order $n$, and $\varphi\colon G\to K$ is an onto homomorphism, let $N=\mathrm{ker}(\varphi)$. Then $G/N\cong K$ by the First Isomorphism Theorem, so $[G:N] = |G/N| = |K| = n$. Thus, $N\triangleleft G$ and $[G:N]=n$, as claimed. Conversely, if $N\triangleleft G$ and $[G:N]=n$, then the canonical projection $\pi\colon G\to G/N$ (with $\pi(g) = gN$) is an onto homomorphism onto a group of order $n$ ($G/N$ is a group because $N\triangleleft G$). $\Box$
As I noted in my comment, you can generalize slightly your observation by restricting to normal subgroups of cyclic number index:
Definition. A positive integer $n$ is called a cyclic number if and only if every group of order $n$ is isomorphic to the cyclic group of order $n$. 
Examples of cyclic numbers are the primes, and $n=pq$ with $p\lt q$ primes and $q\not\equiv 1\pmod{p}$ (e.g., $n=15$). A complete characterization of cyclic numbers is a bit complex to state: given a prime $p$ and a positive integer $\nu$, define
$$\psi(p^{\nu}) = (p^{\nu}-1)(p^{\nu-1}-1)\cdots(p-1).$$
For an integer $n\gt 1$, factor $n$ into primes, $n=p_1^{\nu_1}\cdots p_r^{\nu_r}$, and define
$$\psi(n) = \psi(p_1^{\nu_1})\cdots \psi(p_r^{\nu_r}).$$
Finally, set $\psi(1)=1$. Then $n$ is a cyclic number if and only if $\gcd(n,\psi(n))=1$ and $n$ is squarefree (if $k^2$ divides $n$, then $k=\pm 1$). 
Then a corollary of the theorem above is:

Corollary. Let $n$ be a cyclic number. A group $G$ has a normal subgroup of index $n$ if and only if there is a surjective homomorphism $G\to\mathbf{Z}_n$. 

Proof. If there is a homomorphism $G\to\mathbf{Z}_n$, then by the theorem the kernel is normal of index $|\mathbf{Z}_n|=n$. Conversely, if $N\triangleleft G$ has index $n$, then there is a surjective homomorphism $G\to K$ with $|K|=n$; but since $n$ is a cyclic number, then $K\cong\mathbf{Z}_n$, so there is a surjective homomorphism from $G$ onto $\mathbf{Z}_n$, as claimed. $\Box$
The result cannot be extended to $n$ that are not cyclic numbers. Let $n$ be a number that is not a cyclic number. Then there is a group $K$ such that $|K|=n$ but $K$ is not cyclic. Take $G=K$ and $N=\{e\}$. Then $N\triangleleft G$, $[G:N]=n$, but no homomorphic image of $G$ is cyclic of order $n$.
