Apparently I already proved this but I am having trouble the second time around. It is important to use only basic properties of congruences and orders of elements and Euler's generalization of Fermat's theorem (as that is the section this set of exercises is based on).
It is clear that $a^{2^{n+1}} \equiv 1 \pmod p$ here by squaring both sides.
I know that $a^{p-1} \equiv 1 \pmod p$ here since $a$ is not divisible by $p$ .
It seems obvious to me that the only solutions modulo $p$ to $x^{2} \equiv 1 \pmod p$ are $x = 1,p-1$.
It seems this would help because it would mean that if $2^{n+1}$ was not the order of $a$ modulo $p$, then there must be an $x < 2^{n}$ such that $a^{x} \equiv -1 \pmod p$. I wasn't sure if there was some argument by descent here either.
I also figured that by the division algorithm we can do a similar argument for $a^{x} \equiv -1$ instead of $a^{x} \equiv 1$ where if $x < 2^{n}$ is the order then if the quotient in the division algorithm equation is even, $x | 2^{n} \implies x$ is a power of two $\implies p|2 \implies p=2$ and then check that the $p=2$ case is also satisfied. But then the argument obviously doesn't work if the quotient in that equation is odd because then we can't move a $2$ out to the exponent to square the entire expression.
If we assume for some $x < 2^{n+1}$ we have that $a^{x} \equiv 1 \pmod p$ where $x$ is the order of $a$ modulo $p$ then we must have that $x | 2^{n+1} \implies x$ is a power of $2 \implies x = 2^{k}$ Then $a^{2^{k}} \equiv a^{2^{n+1}} \pmod p \implies p|a^{2^{k}}(a^{d}-1)$ where $d_{2^{n+1}} < 2^{n+1}$. Since $p|a^{2{k}}$ results in the contradiction $p|1$, we must have $p|a^{d}-1$ so that $a^{d} \equiv 1 \pmod p $ if $d < x$, a contradiction too However, we don't necessarily have that $d<x$.
There must be a simple way but I really can't see it.