Last digit of sequence of numbers 
We define the sequence of natural numbers
  $$
  a_1 = 3 \quad \text{and} \quad a_{n+1}=a_n^{a_n},
  \quad
  \text{ for $n \geq 1$}.
$$
I want to show that the last digit of the numbers of the sequence $a_n$ alternates between the numbers $3$ and $7$. Specifically, if we symbolize with $b_n$ the last digit of $a_n$, I want to show that
  $$
 b_n = 
 \begin{cases}
   3, & \text{if $n$ is odd},  \\ 
   7, & \text{if $n$ is even}.
  \end{cases}
$$

There is a hint to prove that for each $n \in \mathbb{N}$, if $a_n \equiv 3 \pmod{5}$ then $a_{n+1} \equiv 2 \pmod{5}$ and if $a_n \equiv 2 \pmod{5}$ then $a_{n+1} \equiv 3 \pmod{5}$.
First of all, if we take $a_n \equiv 3 \pmod{5}$, then $a_{n+1}=3^3\pmod{5} \equiv 2 \pmod{5}$.
If $a_n \equiv 2 \pmod{5}$, then $a_{n+1}=2^2 \pmod{5}=4$. Or am I doing something wrong?
And also how does it follow, if we have shown the hint, that $b_n$ is $3$ when $n$ is odd, and $7$ if $n$ is even?

The mistake you are making is that if $a_n \equiv 2 \pmod 5$ it's not true that $a_n^{a_n} \equiv 2^2 \pmod 5$. The reason behind this is that the exponents aren't repeating in blocks of $5$, but instead in blocks of $\phi(5) = 4$, in your case. Indeed by Fermat's Little Theorem we have that $a_n^4 \equiv 1 \pmod 5$. Thus you need to find $a_n \pmod 4$ first. 
This isn't hard to do, as $a_1 = 3$. Thus whenever it's raised to an odd power we get that $a_n \equiv -1 \pmod 4$. Hence we have:
$$a_n \equiv a_{n-1}^{a_{n-1}} \equiv a_{n-1}^{-1} \pmod 5$$
Now use the fact that $2$ is the modular inverse of $3$ modulo $5$ to conclude that:
$$a_n \equiv \begin{cases}
3 \pmod 5,  & \text{if $n$ is odd} \\
2 \pmod 5, & \text{if $n$ is even}
\end{cases}$$
Finally note that $a_n \equiv 1 \pmod 2$ and use Chinese remainder Theorem to conclude that:
$$a_n \equiv \begin{cases}
3 \pmod{10},  & \text{if $n$ is odd} \\
7 \pmod{10}, & \text{if $n$ is even}
\end{cases}$$
