Help understanding the divergence theorem as it relates to Gauss' Law 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)
 A: I see my comment is just restating what's already been said.  I'll work it out explicitly.
Consider a point charge at the origin.  The field from that point charge is equal to $\vec E = \hat r / r^2$.  At a point $x=0,y=0,z=R$, the electric field is equal to $\vec E = \hat z / R^2$.
Now consider a small cube of side length $a$, centered at $z=R$. If we want to integrate over that volume, we need to consider how the vector field changes over the volume.  Let's make $a$ very very small (compared with $R$), so we only need to keep lowest order terms.
The first order change as we shift in the z-direction is due to the change in the magnitude of the vector: 
$$\vec E = \frac{\hat z}{R^2} - \frac{2\hat z}{R^3}(z-R)$$
If I shift in the $x$ or $y$ directions, there is no first-order change in the magnitude of the vector field, but the field gains a first-order component in the corresponding direction.  Shifting in $x$ gives
$$ \vec E = \frac{\hat z}{R^2} + \frac{x\hat x}{R^3}$$
while shifting in $y$ gives
$$ \vec E = \frac{\hat z}{R^2} + \frac{y \hat y}{R^3}$$
So to lowest order about the point $\vec r = (0,0,R)$, 
$$ \vec E = \frac{\hat z}{R^2} + \frac{x \hat x}{R^3} + \frac{y \hat y}{R^3} - \frac{2(z-R)\hat z}{R^3}$$
It's pretty obvious that the divergence of $E$ remains zero in our expansion (so the volume integral is zero), but what about our surface integral?
Integrating over the bottom surface ($\hat n = -\hat z, z= R-\frac{a}{2}$) gives us
$$\int_{-a/2}^{a/2} \int_{-a/2}^{a/2} -\left[\frac{1}{R^2} - \frac{2(-a/2)}{R^3} \right]dx dy = -\frac{a^2}{R^2} - \frac{a^3}{R^3}$$
while integration over the top surface ($\hat n = \hat z, z=R+\frac{a}{2}$) gives
$$\int_{-a/2}^{a/2} \int_{-a/2}^{a/2}\left[ \frac{1}{R^2} - \frac{2(a/2)}{R^3}\right] dx dy = \frac{a^2}{R^2} - \frac{a^3}{R^3}$$
You claim that the field lines are approximately parallel, so we can stop here because the flux through the walls is zero.  The divergence of our field vanishes, but the integral of the field over the top and bottom surfaces does not sum to zero, and we find that Gauss' theorem is wrong.
But this is incorrect - there is a first-order contribution to the flux through the sides!  All of the flux is passing out of the sides of the cube (and is therefore positive), so we need to add up four contributions.  We need two of these ($\hat n = \pm \hat x, x = \pm \frac{a}{2}$):
$$ \int_{-a/2}^{a/2} \int_{-a/2}^{a/2} \frac{(a/2)}{R^3}  dz dy = \frac{a^3}{2R^3}$$
and two of these ($\hat n = \pm \hat y, y = \pm \frac{a}{2}$):
$$ \int_{-a/2}^{a/2} \int_{-a/2}^{a/2} \frac{(a/2)}{R^3}  dz dx = \frac{a^3}{2R^3}$$
Therefore, we find that the extra flux through the walls exactly cancels variation in flux between the top and bottom surfaces, and Gauss' theorem is preserved.
Tl;dr - be careful with your approximations.  You need to be consistent - if you're working to lowest order, you need to keep all terms to that order.  In this example, the radial variation in field magnitude is of the same order as the directional deviation of the field lines.  By keeping the former and disregarding the latter, you're being inconsistent in your approximations, which leads you to an incorrect conclusion.
A: For mathematically proving the theorem$$\displaystyle\oint_{\partial S=V} \vec{F}\cdot \vec{dS} = \displaystyle\int_V(\nabla\cdot\vec{F}) dV$$
there is absolutely no need (and no sense) of invoking anything like sources or sinks whatsoever. For a good and intuitive mathematical derivation see this chapter from Feynman Lectures. 
The relation of this all with the sources and sinks comes mainly from Physics which I will explain later. But even from a mathematical perspective, one can most certainly define $\nabla\cdot\vec{F}$ as the source of the field $\vec{F}$ because as the above stated theorem implies whenver there is some flux of the field coming out of a closed region, i.e. kind of an overall genesis of the field inside that region, the volume integral of $\nabla\cdot\vec{F}$ is precisely equal to this flux. With this motivation, one can most certainly define $\nabla\cdot\vec{F}$ as the source (or sink) of the field - mathematically. And as long as things are mathematical definitions, there is not much to argue. If there is a non-vanishing divergence of the field then I am, by definition, saying that the source (or sink) is present there. 
Now, what Gauss's law of electrostatics does is that it identifies this mathematically defined source, i.e. the divergence of the field, with the electric charge density (up to a constant which we will neglect). And in this case, it is worth (meaningful) asking whether there really is a need of a charge density for the electric field's divergence to be non-zero and vice-versa. And the answer is, yes. Coulomb's law is an experimental fact, which (owing to its spectacular $\dfrac{1}{r^2}$ dependence) when combined with some simple vector calculus clearly implies that $\nabla\cdot\vec{F}=\rho$. Where $\rho$ is the charge density. If the distance dependence of field had been otherwise then it would mean that you have sources or sinks of the fields (the places where there is non-zero divergence) but the charge density need not be there. 
In the particular example you investigate, the field $\vec{E}=\vec{x}$ can not be created by a point charge located far away - as beautifully illustrated by J.Murray in his answer. You will require a charge density spread over the region you are considering to generate a field of that sort.
A Cheater's Explanation  Since we know that electric field lines never end or originate (pretty much the same thing) in mid-air, every field line that enters a closed empty region must get out of it - making it impossible for a closed empty space to have a non-zero surface integral. But if there is a charge inside the region then field lines terminate or originate there, creating a non-zero surface integral over the surface enclosing the charge. (This is a cheater's explanation because the reason we know field lines don't originate or terminate in mid-air is precisely the Gauss's electrostatics law. Here, we used this derived fact to explain its origin. But works for children these days!)
A: You are misunderstanding the definition of the words "source" and "sink".  A "source" or "sink" of a vector field ${\bf F}({\bf x})$ is a point ${\bf x}$ where ${\bf \nabla} \cdot {\bf F} > 0$ or ${\bf \nabla} \cdot {\bf F} < 0$ respectively, so in your example every point is a source.  The vector field doesn't have to be radial or divergent at a source or sink.
In electrostatics, point particles produce radial and divergent electric fields at their location, but continuous distributions of electric charge produce smooth and not-necessarily-radial electric fields with nonzero divergence.
A: I will try to give a more intuitive answer, as there are already mathematically correct answers. We will say that a vector field $X$ has a sink in some region $\Sigma \subset \mathbb R^n$ , if in some direction, you get less "stuff" then you put in. Think of the analogy of a pipeline, which has a crack, so that the water is seeping out of the crack and hence you get less water on the other side than you put in. 
We will say that a vector field has a source in the region $\Sigma$, if you get more "stuff" than you put in in some direction. Using the analogy as before, think of a pipeline, where someone sneakily is putting more water in some part of the pipeline and as a result you get more water than you put in.
Let's think of your example: $\mathbf k = x \,\hat x$, and let's choose $\Sigma = [0,1]^3$. Clearly at $x=1$ you have more stuff than you do at $x=0$, so someone must be pumping in stuff, so there must be a source in this region and in fact someone is pumping in stuff at each point $x$, albeit very little, so that you get more stuff at the point $x + \epsilon$.
I hope this helps you to understand the Gaus' law intuitively.
