Index mode is not used by anyone anymore for about 15 years now. If that book suggests to use it, it is either extremely old, or the author is an idiot.
“Today” everything is rendered in RGBA mode.
Using a color-table does allow you to do some nice effects (color-table animations), but today no one does that anymore. And even if you wanted to have such behavior, there are much better ways these days (through shaders).
Color index mode is something that’s required to be supported in order to pass conformance, but nobody uses it these days and you can bet that hardware acceleration in color indexed mode is going to be patchily supported at best. Unless you have something very very specific that you know for a fact that color index mode is the only solution for, and unless you don’t care about performance, you really should use RGBA and forget what that book told you.
You can determine whether GLUT_INDEX is supported or not based on the following piece of code, basically glutGet(GLUT_DISPLAY_MODE_POSSIBLE) indicates whether current display mode is supported or not.
glutInitDisplayMode (GLUT_SINGLE | GLUT_INDEX);
if (! glutGet(GLUT_DISPLAY_MODE_POSSIBLE))
glutInitDisplayMode(GLUT_RGB);