Let us consider a spherical shell of radius x and thickness dx. 
Charge on this shell dq=ρ.4πx2dx=ρ0(1−Rx)⋅4πx2dx ∴ Total charge in the spherical region from centre to r(r<R) is q=∫dq=4πρ0∫0r(1−Rx)x2dx=4πρ0[3x3−4Rx4]0r=4πρ0[3r3−4Rr4]=4πρ0r3[31−4Rr] ∴ Electric field at r,E=4πε01⋅r2q =4πε01⋅r24πρ0r3[31−4Rr]=ε0ρ0[3r−4Rr2]