Finding a substance which has a continuous gradient in refractive index
It's not entirely true that no such substance exists, though you won't find this property in a homogeneous substance.

It's well known that changing the concentration of solute in a solution can change the index of refraction; a concentration gradient would then provide a changing refractive index, though having this mimic a square root function would be difficult. Typically, the refractive index changes linearly with the concentration of solute, so a nonlinear function may be difficult to achieve. 
A similar approach could be applied to solids, forming a solid solution, though again there would be some difficulty in finding two compounds with similar lattice parameters that would allow to a continuous gradient between compositions to product the refractive index gradient. 

Your best bet may be with polymers, where changing proportions of the monomers used could change the refractive index; organic dopants can also be used to effect* this gradient in polymers (see, e.g., Polym. Adv. Technol. 2014, 25, 1099). Again, the difficult part would be matching a square-root function, but you could at least have a varying gradient.

*https://xkcd.com/326/