Let's consider an insulating sphere of radius \(r\) with net charge \(q\) distributed uniformly throughout its volume in Figure 1. Now we determine the electric field due to that charge distribution at various points inside, on the surface and outside the sphere.
First we attempt to find the electric field inside the sphere and therefore make a concentric Gaussian sphere of radius \(R'\). Here \(\rho \) is the volume charge density which is the total charge divided by the volume of the sphere. So \(\rho \) is,
\[\rho =\frac{q}{\tfrac{4}{3}\pi {{r}^{3}}}=\frac{3q}{4\pi {{r}^{3}}} \nonumber\]
Now the charge inside the Gaussian surface inside the sphere(\(r > R'\)) is the volume of the Gaussian surface \({\textstyle{4 \over 3}}\pi {{R'}^3}\) multiplied by the volume charge density. So the new charge enclosed by the Gaussian surface q' is,
\[q' = \left( {\frac{{3q}}{{4\pi {r^3}}}} \right)\left( {\frac{4}{3}\pi {{R'}^3}} \right) = q\frac{{{{R'}^3}}}{{{r^3}}}{\rm{ }}\]
And the electric flux through the Gaussian surface inside the sphere is:
\[\Phi = \oint {E\cos \theta dA} = \frac{{q'}}{{{\epsilon_0}}}\]
The sphere is symmetric and charge is distributed uniformly throughout its volume so the electric field is radially outward and also uniform at every point on the Gaussian surface. And you know \(\cos \theta =\cos 0=1\),
\[\begin{align*} \oint {EdA} {\rm{ }} &= \frac{{q'}}{{{\epsilon_0}}}\\ {\rm{or, }}\quad E\oint {dA} &= \frac{{q'}}{{{\epsilon_0}}}\\ {\rm{or,}}\quad {\rm{ }}EA &= \frac{{q'}}{{{\epsilon_0}}}\\ {\rm{or,}}\quad E(4\pi R{'^2}) &= \frac{{q\frac{{R{'^3}}}{{{r^3}}}}}{{{\epsilon_0}}}\\ \therefore E &= \frac{{qR{'^3}}}{{4\pi {\epsilon_0}R{'^2}{r^3}}} = k\frac{{qR'}}{{{r^3}}} \tag{1} \end{align*}\]
This is the expression for the electric field at every point on the Gaussian surface inside the sphere at a distance \(R'\) form the centre. At surface of the sphere \(R' = r\) and the electric field is,
\[E = k\frac{q}{{{r^2}}} \tag{2}\]
This is the same expression as that of conducting sphere. And the electric field is the same as if all the charge were concentrated at the centre of the sphere i.e. the charge on the sphere behaves like a point charge at the centre of the sphere.
To determine the electric field outside the sphere we again make a Gaussian sphere of radius \(R\)(\(R>r\)) outside the sphere. Note that the Gaussian sphere is concentric with the original sphere. In this case the charge enclosed by the Gaussian surface is \(q\) and we can use Gauss's law to calculate the electric field at any point on the Gaussian surface outside the sphere. So, Gauss's law gives
\[\begin{align*} E(4\pi {R^2}) &= \frac{q}{{{\epsilon_0}}}\\ \therefore E &= \frac{q}{{4\pi {\epsilon_0}{R^2}}} = k\frac{q}{{{R^2}}} \tag{3} \end{align*}\]
If you noticed the electric fields inside, on the surface and outside the sphere, you'll find that the electric field increases as \(R'\) increases from \(R'\) to \(r\) inside the sphere and decreases as the distance increases outside the sphere (\(R > r\)).