Show that the number of nonisomorphic finite groups of order $n$ is at most $n^{n^2}.$

You seem to be assuming that if the multiplication tables are different the groups are not isomorphic, but that is not true. What is true is that if the tables are the same the groups are isomorphic. Your argument that there are at most $n^{n^2}$ tables is correct, which shows that there are no more nonisomorphic groups than that.

You can do much better by noting that the table has to have each element once in each column of the table. As there are $n!$ possible columns there are at most $n!^n\approx \left(\left(\frac ne\right)^n\right)^n(2\pi n)^{n/2}$ nonisomorphic groups. For $n=10$ this is $4\cdot 10^{65}$ instead of $10^{100}$ and for $n=100$ it is about $10^{15797}$ instead of $10^{20000}$. Of course, you can do much better by considering that each row must also have one of each element, but I don't see a quick way to quantify that.


Here's how to do a little better than $n^{n^2}$. For a group $G$, define $d(G)$ to be the least positive integer $k$ such that $G$ can be generated by $k$ elements and let $f(n)$ denote the number of non-isomorphic groups of order $n$.

We first show that if $|G| = n$ then $d(G) \leq \log n$. Let $1=G_0 <G_1 <G_2 <\dots < G_r = G$ be a maximal chain of subgroups. Let $g_i \in G_i \setminus G_{i−1}$ for $1 \leq i \leq r$. Then $\langle g_1, \ldots ,g_i \rangle = G_i$, as one easily sees by induction. In particular, $G$ can be generated by $r$ elements. Now by Lagrange’s Theorem $$ |G| = \prod_{i=1}^r [G_i : G_{i-1}] \geq 2^r.$$

Hence $r \leq \lfloor \log n \rfloor$. Then by Cayley’s theorem $G\leq S_n$ and so $f(n)$ is at most the number of subgroups of order $n$ in $S_n$ which is at most the number of $\lfloor \log n \rfloor$-generator subgroups of $S_n$ which is at most the number of $\lfloor \log n \rfloor$-element subsets of $S_n$. This last quantity is $\leq (n!)^{\log n} \leq n^{n \log n}$.