Well, first things first, that is not the only homomorphism. You also have the homomorphism that takes every element to $0$.
That justification seems to be using the fact that $A_4$ is the commutator subgroup of $S_4$. You can see a proof of this fact here.
Now, given an arbitrary group $G$, the commutator subgroup is usually denoted $[G,G]$ and you can show that it's a normal subgroup of $G$. The quotient $G/[G,G]$ is called the abelianization of $G$ and it has the following universal property:
Given an abelian group $H$ and a homomorphism $f:G\to H$, there exists a unique homomorphism $g:G/[G,G]\to H$ such that $f=g\circ\pi$ where $\pi:G\to G/[G,G]$ is the projection. This universal property gives you bijection between homomorphisms $G\to H$ and $G/[G,G]\to H$ when $H$ is abelian.
In your specific case, where $G=S_4$, $[G,G]=A_4$ and $H=\mathbb{Z}_4$, you can show that $S_4/A_4\cong\mathbb{Z}_2$, so there are as many homomorphisms $S_4\to\mathbb{Z}_4$ as $\mathbb{Z}_2\to\mathbb{Z}_4$. Clearly there are only two homomorphisms $\mathbb{Z}_2\to\mathbb{Z}_4$, since you either send $1$ to $0$ or $2$. This already proves the claim, but you can further check that these correspond, by the universal property, to the trivial homomorphism and the non-trivial one that you defined, respectively.
Final comment: these are all basic results in algebra, so, from what you wrote in your question, they probably summed up all of this to "$A_4$ must be in the kernel of your homomorphism $f$", which is equivalent to saying that there exists another homomorphism $g:S_4/A_4\to\mathbb{Z}_4$ such that $f=g\circ\pi$.
I hope this helps.
but how do i show that those two are the only one's there are?
– E. Ginzburg Jul 12 '19 at 07:39