It has to do with the fact that every (non-empty) fiber of a homomorphism is a coset of the kernel. That is, if $\varphi:G\to H$ is a homomorphism, and $h\in\operatorname{im}\varphi,$ then the fiber of $h$ under $\varphi$ is the set $$\{g\in G:\varphi(g)=h\},$$ and is a coset of $\ker\varphi$ in $G$. I outline the proof of this fact (from a linear algebra standpoint) in my answer here, and not much changes in the more general case.
Since $\ker f$ has order two, then for any $\sigma\in S_4,$ we have $f^{-1}(\sigma)$ has cardinality either $2$ or $0$. Since we're assuming that $A_4=\operatorname{im}f,$ then for each $\sigma\in A_4$ (and in particular for each $\sigma\in P_2$) we have $f^{-1}(\sigma)$ has cardinality $2$. Since $P_2$ has $4$ elements by the referenced exercise, then $f^{-1}(P_2)$ is a union of $4$ pairwise disjoint sets of cardinality $2$, meaning that $f^{-1}(P_2)$ has order $8$.
Does that help?
Let's start by finding one subgroup of order $8$. Since this will have the correct order, it will be a Sylow $2$-subgroup. Note that $S_5$ is the group of permutations of $\{1,2,3,4,5\}$. If we view $\{1,2,3,4\}$ as the vertices of a square, and consider the dihedral group of that square, then we have identified a subgroup of order $8$.
Since all Sylow subgroups of a given order are conjugate, this means that all Sylow $2$-subgroups of $S_5$ are isomorphic to $D_8$, the dihedral group of a square. The others are found by choosing different subsets of $\{1,2,3,4,5\}$ for the vertices of the square. Also note that reordering the vertices as, for example, $1,2,4,3$ versus $1,2,3,4$ gives us a different subgroup.
There are $\displaystyle {5 \choose 4} = 5$ ways to choose $4$ vertices from $5$ elements. For each choice of $4$ vertices, there are $6$ ways to order them (assuming we view cyclic shifts such as $1,2,3,4$ and $2,3,4,1$ as the same ordering), resulting in $3$ distinct dihedral groups (because "opposite" pairs of orderings such as $1,2,3,4$ and $1,4,3,2$ result in the same group; just flip the square upside-down to go from one ordering to the other). Thus there are $5 \cdot 3 = 15$ distinct subgroups of order $8$.
Best Answer
Any group with prime order is cyclic. Suppose $|G|=p$ with $p$ prime. Let $a\in G$ and consider the subgroup $H$ generated by $a$. Since the order of $H$ must divide the order of $G$, $|H|=1$ or $p$. If $|H|=1$, the $a$ is the identity element. If $|H|=p$, then $H=G$ and $G$ is cyclic.