Proof (equivalence of Gauss' law)
Gauss' law in integrated form => inverse square law: consider a sphere of radius $R$ of mass $M$ with a spherically symmetric mass distribution. Symmetry allows us to write $\v g(\v x) = g(r)\vhat r$.
Take $S$ to be a sphere of radius $r>R$. Then $$\begin{align*} \int_S \v g(\v x)\cdot d\v S &= \int_S g(r)\,dS \\ -4\pi GM &= 4\pi r^2 g(r) \\ g(r) &= -\frac{GM}{r^2}. \end{align*}$$ This is known as Gauss' flux method.
No proof for inverse square law => Gauss' law :(
Gauss' law in integrated form <=> differential form: using Gauss' theorem, $$\begin{align*} \int_V \nabla\cdot\v g(\v x)\,dV = \int_S \v g(\v x)\cdot\,d\v S &= -4\pi GM = \int_V -4\pi G\rho(\v x)\,dV \end{align*}$$ and since this is true for all volume $V$, $$ \nabla\cdot\v g(\v x) = -4\pi G\rho(\v x). $$