Applying Gauss’s Law: charged sphere
Consider an insulating sphere of radius $R$ carrying a total charge $Q$ and therefore possessing a volume charge density $\rho $ equal to
\rho =\frac{Q}{V}=\frac{Q}{\displaystyle{\frac{4}{3}\pi R^3}}=\frac{3Q}{4\pi R^3}
Charge distribution symmetry and electric field $\overrightarrow{E}$:
By symmetry of the charge distribution, any plane containing the center of the sphere is a plane of symmetry and therefore the electric field is radial, directed outward if $\rho >0$ and directed inward if $\rho <0$.
Choice of a Gaussian surface and applying Gauss’s Law:
For our Gaussian surface, we choose a sphere radius $r$, centered on the insulating sphere.
The insulating sphere has a radius $R$ and we have no reason to assume that the electric field inside the insulating material will be the same as outside of the sphere. Thus, we differentiate two regions: inside the insulating sphere $\left(r\le R\right)$ and outside the insulating sphere $\left(r>R\right)$.
Electric field inside the sphere $\left(r\le R\right)$
The electric flux through our Gaussian surface simplifies because everywhere on the surface of the Gaussian sphere the electric field is along $d\overrightarrow{A}$ and has constant magnitude
\begin{aligned} \oiint_A{\overrightarrow{E}\cdot d\overrightarrow{A}}&=\iint_A{E\mathrm{cos}\left(\theta \right)dA} \\ &=\iint_A{E\mathrm{cos}\left(0\right)dA} \\ &=E\mathrm{cos}\left(0\right)\iint_A{dA} \\ &=E\cdot 4\pi r^2 \end{aligned}
where the area of the Gaussian sphere is equal to $A=4\pi r^2$.
The Gaussian sphere encloses a sphere of charge with volume $V=4\pi r^3/3$ and therefore the amount of enclosed charge is equal to
Q_{enc}=\rho V=\rho \cdot \frac{4\pi r^3}{3}
By Gauss’s Law, we conclude that the magnitude of the electric field created inside the sphere of charge is given by
E\cdot 4\pi r^2=\rho \cdot \frac{4\pi r^3}{3{\varepsilon }_0}\ \ \ \ \Rightarrow \ \ \ \ \ E=\frac{\rho r}{3{\varepsilon }_0}
Thus, the electric field created inside the insulating sphere is equal to
\boxed{\overrightarrow{E}=\frac{\rho r}{3{\varepsilon }_0}\ \hat{r}}
where $\rho >0$ yields radially outward electric field lines and $\rho <0$ yields radially inward electric field lines.
Electric field outside the sphere $\left(r>R\right)$
The electric flux through our Gaussian surface simplifies because everywhere on the surface of the Gaussian sphere the electric field is along $d\overrightarrow{A}$ and has constant magnitude
\begin{aligned} \oiint_A{\overrightarrow{E}\cdot d\overrightarrow{A}}&=\iint_A{E\mathrm{cos}\left(\theta \right)dA} \\ &=\iint_A{E\mathrm{cos}\left(0\right)dA} \\ &=E\mathrm{cos}\left(0\right)\iint_A{dA} \\ &=E\cdot 4\pi r^2 \end{aligned}
where the area of the Gaussian sphere is equal to $A=4\pi r^2$.
The Gaussian sphere encloses a sphere of charge with volume $V=4\pi R^3/3$ and therefore the amount of enclosed charge is equal to
Q_{enc}=\rho V=\rho \cdot \frac{4\pi R^3}{3}
By Gauss’s Law, we conclude that the magnitude of the electric field created outside the sphere of charge is given by
E\cdot 4\pi r^2=\rho \cdot \frac{4\pi R^3}{3{\varepsilon }_0}\ \ \ \ \Rightarrow \ \ \ \ \ E=\frac{\rho R^3}{3{\varepsilon }_0r^2}
Thus, the electric field created outside the insulating sphere is equal to
\boxed{\overrightarrow{E}=\frac{\rho R^3}{3{\varepsilon }_0r^2}\ \hat{r}}
where $\rho >0$ yields radially outward electric field lines and $\rho <0$ yields radially inward electric field lines.
Finally, the insulating sphere creates and electric field at any point in space that is given by
\boxed{ \left\{ \begin{array}{c} \displaystyle{\overrightarrow{E}=\frac{\rho r}{3{\varepsilon }_0}\ \hat{r}\ \ \ \ \ \ \ \ if\ \ r\le R} \\ \\ \displaystyle{\overrightarrow{E}=\frac{\rho R^3}{3{\varepsilon }_0r^2}\ \hat{r}\ \ \ \ \ \ \ if\ \ r>R} \end{array} \right. }
Note: recalling that we have
\rho =\frac{3Q}{4\pi R^3}
where $Q$ is the total charge distributed throughout the sphere. The electric field outside the sphere is then equal to
\overrightarrow{E}=\frac{\rho R^3}{3{\varepsilon }_0r^2}\ \hat{r}=\frac{3Q}{4\pi R^3}\cdot \frac{R^3}{3{\varepsilon }_0r^2}\hat{r}\ =\frac{Q}{4\pi {\varepsilon }_0r^2}\ \hat{r}
This is formula of the electric created by a point charge! This means that once you look at the field outside the sphere, it is as if it were created by a point charge $Q$ located at the center of the sphere.
Electric field lines and graph of the magnitude $E$ vs. $r$:
The electric field lines and the graph of the electric field $\left(\rho >0\right)$ against the radial distance $r$ are sketched below