I don't see why Gauss' Law holds for volumes that contain no source or sink. I am trying to understand Gauss' Law as a general effect of any vector field, so I would appreciate if any answers do not centrally focus on electrostatics.
For an arbitrary 3-dimensional region $R$ placed in a vector field F, the divergence theorem states that the flux integrated across the surface of the volume $R$ is equal to the divergence of the vector field F integrated over the entire volume of $R$:
$$\begin{equation} \oint_S \textbf{F}\cdot\hat{\textbf{n}}\>dS = \int_V \nabla\cdot\textbf{F}\>dV \end{equation}$$
This much makes sense to me, intuitively and mathematically. But, Gauss' Law then states that if the region $R$ does not contain a source or sink, then the left-hand side of the equation above is zero (and hence the right hand side is zero as well).
But this doesn't make sense to me. For example, consider a rectangular region $\bar{R}$ in a two dimensional vector field k such that
$$\textbf{k} = x\hat{x}$$
All boundaries of $\bar{R}$ are parallel to either the $x$ or $y$ axis. I will refer to the "left" and "right" sides of the region $\bar{R}$ as those parallel to the $y$ axis, and the "top" and "bottom" sides as those parallel to the $x$ axis.
The magnitude of k is increasing in the $+x$ direction, so any rectangle $\bar{R}$ drawn in the $+x$ region will have a larger positive flux on its right side, as compared to a smaller negative flux on its left side, and zero flux on the top and bottom.
This region contains no sources or sinks (nor does any region at all in this field), but I don't see how the divergence integrated across the area of $\bar{R}$ could be zero, or how the value of k integrated across the boundary of the shape could be zero either. It seems that in either case it should be positive.
As a physical example, I don't understand how a volume hovering above the Earth's surface could possibly have zero net gravitational flux (which is implied by Gauss' law, since the volume does not contain the source of the field - the Earth)