1. The problem statement, all variables and given/known data
This is from my textbook Engineering Electromagnetics by John Buck and William Hayt 7th Edn, pg 238 in the chapter titled "The Steady Magnetic Field":

3. The attempt at a solution
How does [tex]\nabla \cdot \textbf{B} = 0[/tex] follow from the application of the divergence theorem in this case? It is only required that the volume integral of [tex]\nabla \cdot \textbf{B} = 0[/tex] , but not [tex]\nabla \cdot \textbf{B}[/tex], right?

It appears that your second statement is sufficient for [tex]\int_{\mbox{vol}} \nabla \cdot \textbf{B} \ dv = 0[/tex] but is it also necessary that [tex]\nabla \cdot \textbf{B} = 0[/tex]?

Well GO1, I may be misinterpreting what you wrote, so please correct me if I am, but what you wrote seems to not be accurate. If I understand correctly, you say
[tex]
\int_R{fd\xi} = \int_R{gd\xi} \rightarrow f = g [/tex]
However, an obvious counterexample would be that
[tex]
\int_{0}^{2\pi}\sin xdx = \int_{0}^{2\pi}\cos xdx [/tex]
while the integrands are clearly not the same function.

With regards to the OP's post, the usual argument I have heard is that since S is any surface, V is any volume, and the only way that the integral can be 0 for any volume is if the integrand is identically 0.

Yes, you are correct nick. Sorry for any confusion. I could not remember the exact argument from when I took E&M. I was trying to piece it back together under time constraint and that was the only argument I could think of. If I wasn't at work, I would hopefully have caught that obvious inconsistency. Thanks for the help.

But how do we show that that is the only way it is possible? I was thinking there might be some electromagnetic theory I haven't learnt yet which might show that the volume integral of div B is always zero for all closed surfaces even though div B is non-zero.

I actually have no idea how to prove this, I suspect one might need a bit of analysis that I don't have. It might be easier to prove it in one dimension first For a continuous function f
[tex](\forall a \forall b\int_a^b{f(x)dx}=0)\rightarrow f = 0[/tex]
But I'm not even entirely sure how to prove this.

(The continuity condition is important, as then an obvious counter example would be f(x) = {1 is x is rational, 0 if x is irrational}).

Is this part of a rigorous approach or an intuitive one? nicksauce's post suggests you might be hinting at something rigorous but which I have no idea how to prove it rigorously so I'll just interpret it intuitively.

By continuous you mean to say the value of div B is changes gradually over a vanishing distance dr right? So assuming that means to say if the value of div(B) is non-zero at some point, say, (a,b,c), then the following must be nonzero in the neighbourhood of (a,b,c):

but if that is so then the flux of B through the closed surface encompassing the differential volume at (a,b,c) must be non-zero, by the divergence theorem which contradicts Gauss law for magnetic flux density. Is this right?

(How do you make the latex font smaller for the lim subscript?)

EDIT: I think there's another way it can be proved. The same textbook on pg 68 defined div F as [tex]\nabla \cdot \textbf{F} = \begin{array}{cc}\mbox{lim}\\ \scriptsize{\triangle v \rightarrow 0} \end{array} \frac{\oint_S \textbf{F} \cdot d\textbf{S}}{\triangle v}[/tex] and it is evident that if the numerator is always zero then the div F is always zero as well.

EDIT 2: It looks like both approaches are the same.

That's it. If div(B) is continuous and positive at x, then it's positive in a small region around x. Implying the integral is nonzero. Ditto for negative. Even if you allow discontinuous function like nicksauce's example, the technical answer is that it's still equal to zero 'almost everywhere'. But I wouldn't worry about that.

One last question, is it possible from an EM theory viewpoint as opposed to a mere mathematical viewpoint that div(B) may be discontinuous? Assume steady state magnetic fields at the moment, but I'm willing to consider time-varying fields as well.

There are reasons to consider discontinuous function for div(E). Things like point charges and surface charges. There's no call for anything like that with div(B), there aren't any magnetic sources.

To prove that the divergence of B is zero, just take the divergence of Biot-Savart's Law. It's got some nasty math steps, and you have to employ the divergence of a cross-product, but I have the work in front of me. If I knew LaTex better, I'd post it but as it goes, I have no scanner either.