Periodicity of discrete time signal: $ x\left [ n \right ] = \cos (\frac{\pi n^{2}}{8}) $
You want to prove that $\frac{nN}{8}$ is an integer for any integer $n$. Consider $n=1$. Clearly, $N$ cannot be less than 8.

You also need to prove that $\frac{N^2}{16}$ is an integer. This means that $N$ is a multiple of 4. So, the smallest $N$ that meets both conditions is 8.