The magnetic field at a distance [tex]r[/tex] from a long current carrying wire, has magnitude [tex]|B|=\frac{\mu_0 I}{2\pi} \frac{1}{r}[/tex]
Its direction is always perpendicular to the radial direction.
All that remains is to write this out in Cartesian coordinates and to take the divergence of the resulting function.
If you're not asked for much rigor, you could simply say that the magnetic field lines have no beginning and no end, there is no volume element in space that has more inwards magnetic flux than it does outwards magnetic flux, as there are no magnetic monopoles, therefore, the condition that [tex]\vec \nabla \cdot \vec B[/tex] is satisfied.
Going for the more rigorous approach, let's first make life simple for ourselves. We'll set the current carrying wire along the +x axis and adopt a right-handed coordinate system ([tex]\hat x \times \hat y = \hat z[/tex])
For a vector originating at the x axis, making an angle theta with the xy plane, its components are:[tex]\hat r = \cos{\theta} \hat y + \sin{\theta} \hat z[/tex]
The vector perpendicular to this vector would be [tex]\hat \phi = -\hat r \times \hat x[/tex] (Convince yourself that this is true using a right-hand-rule)
All that remains from here is to take the divergence of the resulting function, [tex]\vec B = \frac{\mu_0 I}{2\pi}\frac{1}{r}\hat \phi[/tex] and to prove that it equals 0 for general values, [tex]r[/tex] and [tex]\theta[/tex], thus proving that the divergence of B is zero everywhere.