A number [tex]n=p_1^{a_1}\cdot p_2^{a_2}\cdot\ldots\cdot p_k^{a_k}[/tex], where [tex]p_k[/tex] are distinct prime numbers, has [tex](a_1+1)(a_2+1)\cdot\ldots\cdot(a_k+1)[/tex] divisors.
We know that [tex]n[/tex] has 7 divisors. 7 is a prime number, so among the numbers [tex]a_1+1,a_2+1,\ldots,a_k+1[/tex] there is only one that is equal to 7.
So,
[tex]a_k+1=7\\
a_k=6[/tex]
That means [tex]n=p^6[/tex] where [tex]p[/tex] is a prime number.
[tex]n^2=(p^6)^2=p^{12}[/tex], therefore the [tex]n^2[/tex] has [tex]12+1=13[/tex] divisors.