How many (non-isomorphic) groups of order 315 are there? Show that all such groups are a direct product of a group of order 5 with the semi direct product of a group of order 7 with a group of order 9.
Please help me fix my solution!  Help appreciated.
The number $315=3^2 \cdot 5 \cdot 7$.  We show that the group is a direct product of $\mathbf{Z}/5\mathbf{Z}$ with a semi-direct product of a cyclic group of order 7 with a group of order 9.
Using the Sylow theorems, the number of groups of order $5$ is either $21$ or $1$.  The number $n_5= [G:N(P_5)]$, where $P_5$ denotes the Sylow group of order $5$.  If $n_p=21$, then $|N(P_5)|=3$, which is not possible since it contains a subgroup $P_5$.  Therefore, there is a unique group of order 5.
Now we need to determine the number of Sylow-7 subgroups.  The number $n_7 \equiv 1 \mod 7$ and $n_7 | 45$.  The only two options are therefore $15$ and $1$.  Let's eliminate 15: we also have by the Sylow theorems that if a Sylow-7 group is called $P$, then $n_p = [G: N_G( P)]$.  If $n=15$, then the normalizer has order 23.  The group $P$ is a subgroup inside of its own normalizer, but $15$ does not divide $23$.
Now we investigate the groups of order $9$.  It is easy to show that all groups of order $p^2$ are abelian.  Therefore, the groups of order $9$ are $\mathbf{Z}/3\mathbf{Z}\times \mathbf{Z}/3\mathbf{Z}$ and $\mathbf{Z}/ 9\mathbf{Z}$.  The automorphisms of $\mathbf{Z}/9\mathbf{Z}$ are determined by the location of the generator.  There are $\varphi(9) = 6$ possible locations.  There are $2$ automorphisms of $\mathbf{Z}/3\mathbf{Z}$, plus we can interchange $(0,1)$ and $(1,0)$ in $\mathbf{Z}/3\mathbf{Z} \times \mathbf{Z}/3\mathbf{Z}$, making for a total of $8$ possible automorphisms.  Subgroups of order 7 have all of their elements order 7, so there cannot possibly be any non-trivial maps from $\mathbf{Z}/7\mathbf{Z}$ into these automorphism groups.
Thus, we find that all of the groups of order $315$ are abelian and take the form $\mathbf{Z} /3\mathbf{Z}\times \mathbf{Z}/3\mathbf{Z} \times \mathbf{Z}/7\mathbf{Z}\times \mathbf{Z}/5\mathbf{Z}$ or $\mathbf{Z}/9\mathbf{Z}\times \mathbf{Z}/7\mathbf{Z}\times \mathbf{Z}/5\mathbf{Z}$.

Here are your errors:

If $n_p=21$, then $|N(P_5)|=3$, which is not possible since it contains a subgroup $P_5$.

No, if $n_5 = 21$, then $\lvert N(P_5) \rvert = \lvert G \rvert / n_5 = 315/21 = 15$, which is not obviously impossible.

If $n=15$, then the normalizer has order 23.

No, if $n_7 = 15$, then the normalizer has order $315/15 = 21$.

The group $P$ is a subgroup inside of its own normalizer, but $15$ does not divide $23$.

The order of $P$ is $7$, not $15$. $7$ does divide $21$.

There are $2$ automorphisms of $\mathbf{Z}/3\mathbf{Z}$, plus we can interchange $(0,1)$ and $(1,0)$ in $\mathbf{Z}/3\mathbf{Z} \times \mathbf{Z}/3\mathbf{Z}$, making for a total of $8$ possible automorphisms.

Actually, there are $48$ automorphisms of $\mathbb{Z}/3\mathbb{Z} \times \mathbb{Z}/3\mathbb{Z}$.
There is a bigger problem here: you seem to be looking at automorphism groups to determine the possibilities for a semidirect product, but you haven't even shown that this group does decompose as a semidirect product! This is easy if all the Sylow subgroups are normal (e.g. by Schur-Zassenhaus), but in general the Sylow subgroups are not all normal (indeed there are non-abelian groups of order 315).
