We know that the electric field inside and outside of a spherical conductor is given by $0$ and $\frac{kq}{r^2}$ respectively. The 2nd formula is derived using Gauss's law by creating a spherical gaussian surface at the distance we are interested in. But Gauss's law states that the flux is $\frac{q_{\mathrm{inside}}}{\epsilon_0}$. But if we consider the sphere itself as the gaussian surface forthe distance $r=R$,we are assuming that a charge $q$ is inside the surface whereas the charge $q$ is on the surface. So no $q_{\mathrm{inside}}$ exists in this case. How are we then still being able to apply the Gauss law?
Below I have attached a picture of an article claiming that the result is actually $\frac{kq}{2R^2}$. Now I am really confused since untill this day I knew it to be $\frac{kq}{R^2}$ but didn't know the proof. Kindly clear this confusion.