I am reading this IMO shortlist problem solution where it, after stating "There exists no numbers $1<m_1,m_2\leq p-2$ such that $m_1m_2\equiv1\text{ (mod }p^2\text{)}$ as $(p-2)(p-2)<p^2$ and $2^2>1$. Therefore, at most half of the values where $a_0^{p-1}\equiv 1\text{ (mod }p^2\text{)}$ are in range $1<a_0\leq p-2$.", which I understand, claims the following.
We can again remove some of the potential values by squaring all $a_0\geq\sqrt{p}$ and taking their inverse. As long as no more than half of the values in that range can have the required property, there must be a pair $a$ and $a+1$ that satisfy the requirements by the pigeonhole principle. $$\frac{p-\sqrt{p-2}-1}{2}\leq\frac{p-3}{2}$$
I do not understand the above derivation. Could someone please illustrate it?