I have tried to go through a proof for this which is used in physic texts:
$$\nabla \cdot \vec{A}=\frac{\mu _0}{4\pi}\nabla \cdot \int \frac{ J(r')}{|r-r'|} dV'$$
again we use
$$ \nabla \cdot \frac{ 1}{|r-r'|}=-\nabla' \cdot \frac{ 1}{|r-r'|}$$
If you go through the equations you would obtain that you could write:
$$\nabla \cdot \vec{A}=-\frac{\mu _0}{4\pi} \int J(r') \cdot \nabla' \frac{ 1}{|r-r'|} dV'$$
Then they look at the integration as from integration by parts
$$\int_{-\infty}^\infty g \frac{\partial f}{\partial x} dx = [gf]_{-\infty}^\infty - \int_{-\infty}^\infty f \frac{\partial g}{\partial x} dx$$
initially the integral is over the current which does not go from $$-\infty \:\: to \:\: \infty$$. I could perhaps reason and say that integrating from $$-\infty \: to \: \infty$$ would get the same result. But if we extend the reasoning I did get to
For the $$-\infty \:\: to \:\: \infty$$ we did get:
$$\nabla \cdot \vec{A}=-\frac{\mu _0}{4\pi} \int_{-\infty}^\infty J(r') \cdot \nabla' \frac{1 }{|r-r'|} dV'$$
$$ J(r') \cdot \nabla' \frac{1 }{|r-r'|}=J(r') \cdot[\frac{\partial}{\partial x'}\textbf{i}+\frac{\partial}{\partial y'}\textbf{j}+\frac{\partial}{\partial z'}\textbf{k}] \frac{1}{[(x-x')^2+(y-y')^2+(z-z')^2]^{0.5}}$$
for the first component:
$$ g=J_x(r')$$ $$f=\frac{1}{[(x-x')^2+(y-y')^2+(z-z')^2]^{0.5}}$$
If we would have kept the integration limits from dV' it would be apparent that
$$ [gf] \neq0$$
If we increase to from $$-\infty \:\: to \: \: \infty$$ it would be apparent that
$$\int_{-\infty}^\infty g \frac{\partial f}{\partial x} dx $$
would not change after the increase in integration limits to $$-\infty \: \: to \: \: \infty$$
and
$$- \int_{-\infty}^\infty f \frac{\partial g}{\partial x} dx$$
would change since $$\frac{\partial g}{\partial x} $$ is undefied when the current density ends
but with from $$-\infty \:\: to \:\: \infty$$ we would get
$$ [gf]_{-\infty}^\infty =0$$
which is a change? How does this prove that $$\nabla \cdot A=0$$ ?
Additional info:
Here is a proof from a physic text just in case. C below is used as current density above: