$\,ax\equiv b\!\!\overset{\large \times\ a^{p-2}\!\!\!\!\!}\iff x\equiv a^{p-2}b\,$ proves both existence $(\Leftarrow)$ and uniqueness $(\Rightarrow)$. Recall that scaling by a unit (invertible) always yields an equivalent equation (congruence). Here $(\Rightarrow)$ we scaled by $\,a^{-1}\equiv a^{p-2}\,$ by Fermat. The reverse $(\Leftarrow)$ is the inverse operation: scaling by $\,a\equiv (a^{-1})^{-1}$
Remark $ $ Thus the proof is no different from the same proof that $\,ax = b\,$ has a unique solution for rationals or reals, i.e. if $\,a\neq 0\,$ then $\,ax = b\iff x = a^{-1}b,\,$ by scaling by invertibles $\,a\,$ or $\,a^{-1}$.
See here and here for much further discussion of subtleties regarding such uniqueness.
\pmod{p}
to generate the parenthetical(mod p)
with appropriate spacing. – Arturo Magidin Nov 03 '19 at 06:37