How to derive Gauss's law for magnetism? We know how to derive Gauss's law for electric field from Coulomb's law but i need to know how to derive Gauss's law for magnetism from biot-savart law?
 A: The answer depends on the assumptions. When you ask how to derive something you must ask yourself from what you want to derive it.
For example: if you experimentally find out that there are no magnetic monopoles, since you simply don't observe them, and you state this as a law of Physics, then Gauss's law for magnetism is the mathematical way to express this law.
On the other hand, if you consider magnetic fields produced by current densitites via Biot-Savart law, then you do have one assumption and the assumption is your starting point.
The assumption is exactly Biot-Savart law which reads:
$$\mathbf{B}(\mathbf{x})=\dfrac{\mu_0}{4\pi}\int \dfrac{\mathbf{J}(\mathbf{x}')\times (\mathbf{x}-\mathbf{x}')}{|\mathbf{x}-\mathbf{x}'|^3}d^3\mathbf{x}'.$$
Then you can compute
$$\nabla\cdot \mathbf{B}(\mathbf{x})=\dfrac{\mu_0}{4\pi}\nabla\cdot \int\dfrac{\mathbf{J}(\mathbf{x}')\times (\mathbf{x}-\mathbf{x}')}{|\mathbf{x}-\mathbf{x}'|^3}d^3\mathbf{x}'.$$
Now the integral is on $\mathbf{x}'$ and the derivative is on $\mathbf{x}$. Under the regularity assumptions usualy done you can move the divergence into the integral. Apply then the product rule:
$$\nabla\cdot \mathbf{A}\times \mathbf{B}=\mathbf{B}\cdot\nabla\times \mathbf{A}-\mathbf{A}\cdot \nabla\times \mathbf{B}$$
When $\mathbf{A}$ is constant this is $\nabla\cdot \mathbf{A}=-\mathbf{A}\cdot \nabla\times \mathbf{B}$. Since $\mathbf{J}(\mathbf{x}')$ is constant with respect to $\mathbf{x}$ you get
$$\nabla\cdot \mathbf{B}(\mathbf{x})=-\dfrac{\mu_0}{4\pi}\int\mathbf{J}(\mathbf{x}')\cdot \nabla\times \dfrac{\mathbf{x}-\mathbf{x}'}{|\mathbf{x}-\mathbf{x}'|^3}d^3\mathbf{x}'$$
It is a mathematical result that the curl inside the integral is zero (it is also used to show the electrostatic field is conservative). The conclusion is
$$\nabla\cdot \mathbf{B}(\mathbf{x})=0.$$
This is a derivation of Gauss's law for magnetism on the assumption that the magnetic field is given by Biot-Savart law.
On the other hand, if one starts by building the Electrodynamics Lagrangian on spacetime $(M,g)$ with $F = dA$ the electromagnetic field two-form in terms of the $4$-potential, by whatever arguments one sees fit (Matthew Schwartz on the book "QFT and the Standard Model" does quite a good job on motivating the Lagrangian):
$$\mathcal{L}[A_\mu,\nabla_\nu A_\mu]=-\dfrac{1}{4}F_{\mu\nu}F^{\mu\nu}-A_\mu J^\mu$$
the equations of motion are Maxwell's equations $dF = 0$ and $d\star F = \star J$. And in a specific reference frame this yields in particular $\nabla \cdot \mathbf{B} = 0$.
As I said: how to derive depends on "from where to derive", i.e., what assumptions you want to use.
A: It's exactly the same idea as for the electric case. "Derive" it from the inverse square law in the static case. Postulate its broadened truth to the dynamic case. Now set $q=0$, from the further postulate that there are no magnetic monopoles.
Even more simply and geometrically, as in ZeroTheHero's answer, write down "flow lines of $\vec{B}$ never end" as your basic postulate and you're there for both the static and dynamic case. The pretty thing about this geometric idea for both the electric and magnetic case is that it implicitly gives you a definition of charge as a source / sink of flowlines - that's if a hardcore concentration on the "field" and its geometry as the ultimate physical reality here is to your taste (as it is mine). Aside from the measureables like forces that arise through the Lorentz law as the realities, of course (bowing to the Experimentalist gods here).
In exterior calculus language the idea becomes "tubes of the Faraday Tensor $F$ never end". There is a beautiful motivation for this in Chapter 4 of Misner, Thorne and Wheeler, "Gravitation" where one postulates the Lorentz covariance of $F$ and then demands that lines of $\vec{B}$ must never end in any inertial frame. Out pops Faraday's law of induction for free from this notion, and Gauss's magnetic law and Faraday's law combine to become $\mathrm{d} F=0$ or "tubes of $F$ never end".
