Gauss's law is pretty easy to prove from Coulomb's law. We want to prove it for any closed surface and any distribution of charge. A distribution of charge can be idealized as a bunch of individual point-like charges, so we only need to prove Gauss's law holds for any closed surface and a single point charge.
There are two cases which are extremely easy to prove. The first case is that of a sphere with a point charge at its center. Let the sphere be of radius R and let the charge be Q. Since the charge is at the center of the sphere, the electric field has the same magnitude E = Q/(40) at every point on the sphere, and since the field is radial, the flux reduces to just = EA = 4R2E. It then follows directly that = Q/0.
The second easy case is that of a "cap". Consider two concentric spheres. On the surface of the inner sphere, draw some region. Take the corresponding region on the surface of the outer sphere by drawing lines from the center of the spheres through the boundary points of the inner region. The space between these regions is a "cap"; its boundary surface consists of the two regions of the spheres and the "collar" that connects them. It's kind of like a thick piece of orange peel. Here is an example, which looks more like a cork than a cap:
If a charge is placed at the center of the spheres, it is easy to prove that the electric flux through the surface of the cap is zero. There is no flux through the collar, because the field lines, being radial, lie along the surface and are thus perpendicular to the normal to the surface. The normal to the inner surface is directed toward the center of the spheres; this means that if the charge is positive so that the field points away from the center, the flux through the inner surface will be negative. The normal to the outer surface is directed outward, so that the flux through the outer surface will be positive. So the total flux through the cap is
However, both A and a subtend the same solid angle, so A/R2 = a/r2, so that, indeed, = 0.
This has only proved Gauss's law for two very special cases. How can we prove the general case of a point charge and any closed surface anywhere?
The answer is that we can approximate, as closely as we like, an arbitrary region of space by a conglomeration of caps, and (if the charge is inside the region) a sphere. This is not easy to prove rigorously, but an example should make it clear. Here is a cylinder with a charge at its geometrical center. (You are looking at a longitudinal cross section.) Using only a sphere and six caps, we have made a fairly good approximation of the cylinder.
Now we have proved Gauss's law for any closed surface and for the electric field of a single charge. We can generalize to the case of a distribution of charge by approximating the distribution by an array of infinitesimal pieces of charge and considering these pieces to be point charges. The field of each piece obeys Gauss's law over a closed surface, so the total field also obeys Gauss's law over that surface.
Once again: