Let's use Gauss' Law to calculate the field from a point charge. We know the field from a point charge Q is radial (the field lines are directed along radii, directly out from or into the charge). The appropriate gaussian surface here is a sphere of radius r centered on the charge.
The charge enclosed by the sphere is Q.
The net flux through the sphere is simply EA, because the field lines are perpendicular to the surface at all points. A is the surface area of the sphere, 4pr2. Applying Gauss' Law:
Net flux = FE = 4pr2E = Q/eo
Solving for E gives:
E = Q/4peor2 = kQ/r2
This agrees with what we've said before, giving us some confidence in Gauss' Law.
Now we'll consider a finite charge distribution. Again we'll apply Gauss' Law to determine the electric field. If the sphere is an insulator, has a radius R, and has a charge Q distributed uniformly throughout the sphere, what is the electric field as a function of r, the distance from the center of the sphere?
Compare the electric field from a point charge Q to the electric field outside the insulating sphere. Surround the object with a gaussian sphere, apply Gauss' Law, and in both cases you get:
E = kQ/r2
So, outside a sphere of charge the field looks like that from a point charge.
Inside is a different story. First let's answer this question. What is the electric field at the very center of the sphere?
Place a gaussian sphere inside the insulating sphere at a radius r < R. How much charge is enclosed by the sphere? What is the flux?
The charge enclosed by the gaussian surface is the charge per unit volume multiplied by the volume of the sphere. The volume of the gaussian sphere is:
Vg = (4/3)pr3
The uniform charge per unit volume r in the insulating sphere is its total charge (Q) divided by its total volume.
r = Q/[(4/3)pR3 ]
The charge enclosed by the gaussian surface is then:
qenc = Qr3/R3
The flux through the gaussian surface is EA = 4pr2E
Applying Gauss' Law:
Net flux = FE = 4pr2E = Qr3/R3eo
Factors of r2 cancel. Solving for the electric field inside the insulating sphere gives:
E = Qr/4peoR3
So, inside the sphere the field is proportional to r, and outside it's proportional to 1/r2. Note that the two equations agree at the boundary, where r = R.