Since we do a 4 sample DFT, we will be looking at powers of the complex 4th root of unity.
$w$ is the complex fourth root of unity $w^4 = 1$, we can pick $w = i$ or $w=-i$
It seems this aufgabe chooses the negative one. Now substitute $-i$ everywhere and you will get the matrix.
$$\cases{(-i)^0 = 1\\\\(-i)^1 = -i\\\\(-i)^2 = -1\\\ (-i)^3=i}$$
And then it will be periodic, $w^5=w$ et.c.