The only numbers with exact $2$ proper divisors are the numbers of the form $p^2$, where
p is a prime.
The proper divisors are $1$ and $p$ in this case, and $p+1$ with $p$ prime
can only be a perfect square for $p=3$.
This follows from the equation $p=a^2-1=(a-1)(a+1)$. If $a>2$ , then $p$ cannot be a prime.
So, there is only $1$ case of
$2$ divisors.
For the case of $4$ divisors, we have to find all primes $p$, such that
$p^3+p^2+p+1=(p+1)(p^2+1)$ is a perfect square.
Suppose, $q$ is a divisor of $p+1$ and $p^2+1$, so we have $p\equiv -1\ (\ mod\ q\ )$ and
$p^2\equiv -1\ (\ mod\ q\ )$.
Since we also have $p^2\equiv 1\ (\ mod\ q\ )$, we
can conclude $q=2$.
The case $gcd(p+1,p^2+1)=1$ would imply, that $p+1$ is a square, which is only
possible for $p=3$, as already mentioned, but $3^2+1=10$ is not a square.
So, we can conclude that
$$p+1=2a^2\ \ \ \ \ \ \ p^2+1=2b^2$$
with $gcd(a,b)=1$
It seems that only $p=7$ solves these equations. If there is another solution, it must
contain more than $100\ 000$ digits which I checked examining the solutions of the
equation $x^2-2y^2=-1$
The number of proper divisors is even only for squares. I checked them and
found two more examples for an even number :
$$35713^2=1275418369$$
has $8$ proper divisors.
$$102851^2=10578328201$$
has $14$ proper divisors.
Furthermore, I found an example with $3$ distinct prime factors :
$195534000$ has $399=3\times 7 \times 19$ proper divisors.
If $\gcd(n,\phi(n))=1$, then $n$ must be square-free.
To see this, assume $p^2|n$ for some prime $p$. Then $p|\phi(n)$, and so $p|\gcd(n,\phi(n))$.
If $n=p_1\cdots p_m$ where $p_1,\ldots,p_m$ are distinct primes, then the divisors of $n$ are all numbers formed by the product of a subset of these, and there are $2^m$ such subset (including the whole set which results in $n$ itself, and the empty set which gives 1).
Best Answer
If $n=p^4s^2$ with $p$ prime, $s$ is a product of $m\ge1$ distinct primes $q_1,\ldots,q_m$ and $p\nmid s$, then $$\tau(n) =\tau(p^4)\tau(q_1^2)\cdots \tau(q_m^2)=5\cdot 3\cdots 3=5\cdot 3^m$$ and $$\tau(n^2) =\tau(p^8)\tau(q_1^4)\cdots \tau(q_m^4)=9\cdot 5\cdots 5=3^2\cdot 5^m.$$ It follows that for such $n$, we have $\tau(n)\mid\tau(n^2)$ only if $m\le 2$. This allows us to find an explicit counterexample: Let $n=420^2=176400$. Then $$\begin{align}\tau(n)&=\tau(2^4\cdot 3^2\cdot 5^2\cdot 7^2)=135\\\tau(n^2)&=\tau(2^8\cdot 3^4\cdot 5^4\cdot 7^4)=1125=8\cdot 135+45.\end{align}$$
It is also not hard to find counterexamples to the other direction: Let $$n=29674142746122490321305600000000000000000000.$$ Then $$\begin{align} \tau(n)=\tau(2^{40}3^{24}5^{20}7^211^213^2)&=41\cdot25\cdot 21\cdot 3^3\\ \tau(n^2)=\tau(2^{80}3^{48}5^{40}7^411^413^4)&=81\cdot49\cdot 41\cdot 5^3=35\cdot \tau(n).\\ \end{align}$$