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?
This is how I see it. $G$ has 3 2-Sylow subgroups, and 4 3-Sylow subgroups. So $G$ acts on the 3-Sylow subgroups by conjugation, resulting in a map $\phi:G → S_4$. Let $K$ be the kernel of this map. Let $P$ be a 3-Sylow subgroup, and restrict $\phi$ to P; call the map $\phi_P$. Then the Sylow Permutation Theorem* states that the only fixed point of $\phi_P$ on the 4 conjugates is $P$ itself. This means that $\phi_P$ acts nontrivially on the other three 3-Sylow subgroups, implying that $K$ cannot contain an element of order 3, so that the order of $K$ is not divisible by 3, so it has to be 1, 2, 4, or 8.
Let $\psi: G → S_3$ be the action of $G$ on the 2-Sylow subgroups. Then $G$, order 24, acts on $S_3$ of order 6, implying a normal subgroup $V$ in $G$ of order 4. This subgroup then combines with a 3-Sylow subgroup, by semi-direct product, to form a subgroup $A$ of $G$ of order 12. There can be only one such subgroup of order 12, as there is no room for any more. So $A$ is of order 12 without normal 3-Sylow subgroups, so it is isomorphic to $A_4$ and $V$ is isomorphic to the Klein four-group. The 2-Sylow subgroups are of order 8, and each one of them must contain $V$ as a subgroup. Hence we have 1 identity element, 3 elements in $V$, 4 x 3 or 12 elements in the 2-Sylows outside of $V$, and 8 elements of order 3, accounting for all 24 elements of G. There is no more room for any more.
$K$ cannot be of order 8, because the subgroups of order 8 are not normal. $K$ cannot be of order 2, since in that case $K$ would be normal in $G$, so it combines with $P$ to form a subgroup of order 6 with subgroups of order 2 which are normal, hence is $Z_6$, containing elements of order 6, for which there is no room. Finally, $K$ can't be of order 4, since the normalizer of $P$ and its conjugates is of order 6, so the intersection of all these normalizers has to have order 1, 2, 3, or 6 and be contained in $K$, so it can't have order 4.
Therefore, $K$ is the trivial group, so that $\phi$ is an isomorphism between $G$ and $S_4$.
*The Sylow Permutation Theorem says that if a group $G$ has $n$ $p$-Sylow subgroups, then $G$ acts on $Syl_p(G)$ by conjugation, and the only fixed point of this action restricted to $P$ is $P$ itself. This occurs throughout the literature, mainly in proving that there are no simple groups of some specified order, but not as a theorem by itself.
Best Answer
You know $P$ has order $3$ and $K$ is a subgroup of $P$. Thus $K$ has order $1$ or order $3$ (Lagrange). If $K$ has order $3$, then $K = P = N_G(P)$, which means that $P$ is normal in $G$ (since the kernel $K$ is normal), a contradiction. Thus we must have $K=1$.