Find $\pi_g(x)$ for all $x \in \mathcal{D}_8$ and $x \in X$ Let $X=\{\spadesuit, \heartsuit, \diamondsuit, \clubsuit\}$ and suppose $\pi$ is an action of $\mathcal{D}_8$ on $X$ satisfying


*

*$\pi_s(\diamondsuit)=\spadesuit;$

*$\pi_{rs}(\spadesuit)=\heartsuit$;

*$\pi_{r^2}(\heartsuit)=\heartsuit$.
Find $\pi_g(x)$ for all $g \in \mathcal{D}_8$ and $x \in X$.

Since it's an action, I know that $\pi_1(x)=x$. But then, let's say
$$\pi_{rs^2}(\spadesuit)=\pi_r\circ\pi_{s^2}(\spadesuit)=\pi_r\circ\pi_1(\spadesuit)=\pi_r(\spadesuit),$$
but then I don't have any information on that so I cannot simplify this. So is it just a case of trial and error until I can definitively find a map and then go from there? Or is there a more savvy way to get started on this that has completely been lost on me?

Here, we have $\mathcal{D}_8=\{1,r,r^2,r^3,s,rs,r^2s,r^3s\}$ with the group operations defined by $r^4=s^2=1$ and $sr=r^3s$.
 A: Let $S$, $H$, $D$, and $C$ denote the spade, the heart, the diamond, and the club symbols, respectively.  I assume that the four symbols are pairwise unequal (this is not quite stated in the problem statement, but it is a natural assumption to be made).  Also, $g\cdot x$ denotes $\pi_g(x)$ for all $g\in \mathcal{D}_8$ and $x\in X$.
We have from the hypothesis that
$$s\cdot D=S\,,\,\,(rs)\cdot S=H\,,\text{ and }r^2\cdot H=H\,.$$
That is, 
$$D=s^2\cdot D=s\cdot(s\cdot D)=s\cdot S=r^{-1}\cdot\big((rs)\cdot S\big)=r^{-1}\cdot H=r^{-1}\cdot \left(r^2\cdot H\right)=r\cdot H\,.$$
If $r\cdot S=H$, then
$$D=r\cdot H = r^3\cdot H=r^2\cdot D=r^2\cdot (s\cdot S)=s\cdot\left(r^2\cdot S\right)=s\cdot (r\cdot H)=s\cdot D=S\,,$$
which is a contradiction.  If $r\cdot S=D$, then
$$S=r^3\cdot D=r^2\cdot(r\cdot D)=r^2\cdot H=H\,,$$
which is absurd.  If $r\cdot S=S$, then
$$H=(rs)\cdot S=\left(sr^3\right)\cdot S=s\cdot \left(r^3\cdot S\right)=s\cdot S=D\,,$$
which is another contradiction.  That is, $r\cdot S=C$ is the only possibility.
From the work above, it can easily be seen that the action of $r$ is given by the permutation $(S,H,D,C)\mapsto (C,D,H,S)$, while the action of $s$ is given by the permutation $(S,H,D,C)\mapsto (D,C,S,H)$.  Hence, the left $\mathcal{D}_8$-set $X$ is isomorphic to the left $\mathcal{D}_8$-group $\mathcal{D}_8/\!/\left\langle r^2\right\rangle$ of left cosets of $\mathcal{D}_8$ via the identification $S=\left\langle r^2\right\rangle$, $H=(rs)\cdot \left\langle r^2\right\rangle$, $D=s\cdot \left\langle r^2\right\rangle$, and $C=r\cdot\left\langle r^2\right\rangle$.
