Confusion about Gauss's law Often times Gauss's law is used to calculate electric fields in various situations. For example, we use Gauss's law for calculating the electric field of an infinite sheet of charge which turns out to be uniform. But isn't Gauss's law valid only for inverse-squared fields? Why the use of Gauss's law is justified here in the first place? I'm sorry if the question is stupid.
 A: The inverse-square laws for point charges and outside spherically symmetric charge distributions follow from the more general Gauss's law, which linearly generalises the case of point charges and can be used for any charge distribution.
A: In the case of an infinite sheet of charge, the simple explanation is that the electric field does not die off in an inverse square fashion because the charges extend out to infinity in the $x-y$ plane. The infinities here effective kill of powers of $r$ in the denominator. If you are familiar with integral calculus, you could perform the calculation
$$\vec{E} = \frac{1}{4\pi\epsilon_0}\int \frac{dq}{r^2}\hat{r}.$$
Here, $r$ is the magnitude of the displacement vector. From the form of this equation, we see that the electric field is just the sum over point charges which have an inverse square law dependence. Defining the end point to be along the $z$ axis, you can find the electric field to be
$$\vec{E} = \frac{\sigma}{2\epsilon_0}\hat{z}.$$
The idea is that you break the plane of charge into point charges. Each of these point charges have an electric field which goes like $1/r^2$. $\bf{But}$ when you add up the contributions from all the point charges, the field does not die off like $1/r^2$. This is the exact same answer that you get by using Gauss's law.
So we see that Gauss's law is valid if the electric field from the $\bf{point}$ charges goes like $1/r^2$. But the electric field due to the total charge distribution does not have to obey this dependence.
A: You are messing up the field by an individual charge and the total field produced by a collection of charges. In electrostatics, Gauss's law is a result of the fact that a charge gives an inverse-square field. But many such fields together can give fields of many different forms. Gauss's law is valid when the field of each individual charge is an inverse-square field. But you cannot say that Gauss's law is invalid when the total field is not.
You need not consider infinite plate, that makes you confused. Just consider two point charges. The field is not a simple Coulomb field, but are you going to say that Gauss's law cannot apply to these two charges? If you understand why Gauss's law is still valid for two charges, you will understand why it is valid for many charges, and in particular, for an infinite plate of uniform charges.
In your reply to another answer, you said "But in order to obtain the result $\oint \vec{E}\cdot d\vec{a}=q/\epsilon_0$,we must assume that E obeys the inverse-squre law in the first place". This is wrong. $E$ is the total E field, which need not be inverse square. What we request is the E should be be sum of some Coulomb fields.
