Show that $\nabla \cdot (\nabla \times \vec A) = 0 $ for an arbitrary differentiable vector field $\vec A$ using Stokes' Theorem for an arbitrary closed surface S followed by Gauss' Theorem.
An attempt at the solution:
Using Stokes' Theorem:
$$\oint_{C=\partial S} \vec A \cdot d\vec l = \int_S (\nabla \times \vec A) \cdot d\vec S$$
Letting $S=\partial V$ and using Gauss' Theorem:
$$\oint_{S=\partial V} (\nabla \times \vec A) \cdot d\vec S = \int_V \nabla \cdot (\nabla \times \vec A) \:dV $$
Hence,
$$\oint_{C=\partial S} \vec A \cdot d\vec l =\int_V \nabla \cdot (\nabla \times \vec A) \:dV $$
It looks like I should be able to arrive at the solution from some logic being applied to this equality, but I am unsure what that would be.
Okay. To start, we take a closed curve $C$ on the boundary of V ($S = \partial V)$, so that $C\subset \partial V$. Then the surface $\partial V$ is broken into two parts, suppose they are $S_1, S_2$. ($S_1\cup S_2=S$)
Then, as your attempted solution; using Stoke's Theorem, $$\oint_C \vec{A} \cdot d\vec{l}=\int_{S_1}(\nabla \times \vec{A})\cdot d \vec{S}$$ $$-\oint_C \vec{A} \cdot d\vec{l}=\int_{S_2}(\nabla \times \vec{A})\cdot d \vec{S}$$ I don't know how I should formally state this, but since the orientation of the curve $C$ in the LHS of the first and second integral are different, they have the same absolute value and different signs.
So add these, so that $$0=\int_{S_1}(\nabla \times \vec{A})\cdot d \vec{S}+\int_{S_2}(\nabla \times \vec{A})\cdot d \vec{S}=\oint_{S}(\nabla \times \vec{A})\cdot d \vec{S}$$ then now you can use Gauss' Theorem, as you did in your solution.
Then, we get
$$\oint_{S}(\nabla \times \vec{A})\cdot d \vec{S}=\int_V \nabla \cdot (\nabla \times\vec{A})dV=0$$
Since this must hold for arbitrary $\vec{A}$, $$\nabla \cdot (\nabla \times\vec{A})=0$$
I hope this helped.