Gauss's law says that the flux through a closed surface which contains neither a sink nor a source will be zero.
It's quite clear that all field lines will have to exit somehow, but the strength of the E-field is also proportional to the inverse of the distance squared.
So if, for example, we have a cube, and the E field is perpendicular to one of the sides, the electric flux through that one side will be $A * E$ = $A$ * $kq \over r^2$. But on the opposite side, the distance from the source of the E field will be larger, so the magnitude of the E field should be smaller.
Where is my misconception? Thank you.
EDIT: Okay, the point charge was just an example.
I'll ask it differently:
All the proofs I've seen of this concept state that "all field lines that enter the closed surface must also leave the closed surface, hence the total flux will be zero".
But how does this account for the differences in the distances of the sides of
the closed surface from the source of the charge?
Can someone refer me to a proof or give an explanation of why the differences in distances always balance out with the differences in area in order to give you a zero result?