Number of group homomorphisms from $D_4$ to $S_{3}$ 
How many group homomorphisms are there from the dihedral group  $D_4$ with eight elements to $S_{3}$?

I am really confuse about this type of problem. How do we find all the group homomorphisms between them, I don't even know how to define the function between them. Can anyone tell me about that?
 A: Let $f:D_4\to S_3$ be a group homomorphism .By First Isomorphism Theorem;
$D_4/\ker f \cong \text{Image }f$.
Possible orders of $\text{Image }f=1,2,3,6$ .Now $|\text{Image }f|\neq 3,6$ 
If $|\text{Image }f|=1\implies f(a)=e \forall a\in D_4$ where $e$ denotes the identity mapping in $S_3$.
If $|\text{Image }f|=2\implies |\ker f|=4$ .
Take  $\text{Image }f=\{e,(12)\}/\{e,(23)\}/\{(e,13)\}$.
Also $D_4$ has three normal subgroups of order $4$ denote them by $T_1,T_2,T_3$.
So we can have $3\times 3$ choices for homomorphisms when $|\text{Image }f|=2$
So we have $9+1=10$ group homomorphisms.
A: Hint: The dihedral group with eight elements is the set of symmetries of a polygon with 4 vertices, symbolized $D_4$. The group is generated by a rotation $r$ of order 4, and a reflection, $s$ of order 2. That is, $D_4=\langle r, s\rangle$. So any group homomorphism from $D_4$ into $S_3$ must assign $r$ to an element whose order is divisible by 4, and $s$ to an element whose order is divisible by 2. These selections will determine the homomorphism completely.
So now the question becomes - how many elements of order 1,2, or 4 are there in $S_3$?
