I have a Nikon D5100. When shooting indoor photos using the built in flash, the auto ISO changes to 1600 or so.
Doesn't the flash produce enough light so that the ISO would stay at 100 or so?
The ISO used will depend upon flash power, how bright/dark the scene is, the subject distance, and what settings the camera and flash are using. That is, it's possible that no, ISO 100 can't be used because the flash doesn't provide enough light.
The D5100 built-in flash has a guide number of 39 (measured in feet) at ISO 100. By the math, GN39 / 10 feet (subject distance) = f3.9 at ISO 100, so there should be just enough power to light the subject using the flash at nearly full power. But, flash power isn't the only decision to be made when taking the photo.
Note that at 18mm and f3.5, the depth of field is from roughly 6ft to 28.5 ft. That is, the scene is rendered in-focus from 6 ft to 28.5 ft. With the camera set to full auto, it could well be trying to get everything lit out to 28.5 ft. The math: GN39 / 28.5 ft = f1.39 at ISO 100 -- which I'm sure your lens can't do. It's almost 3 stops out to f3.5, which means the minimum ISO you can probably use is ISO 800. It's only 1/2-stop to the ISO 1250 your camera used, which could certainly be due to how the scene was metered and what your camera thought should be done.
Back to the initial question: the flash does have just enough power to light the subject as you've described it. The trick is that you can't let the camera decide how to do it: you need to make the decisions. In full auto the camera is just trying to get a technically-correct photo; it has no idea what sort of photo you envision. Switch to the manual or aperture priority modes and set the ISO to 100, the aperture to 3.5, and the shutter to 1/60 and shoot, and I bet you'll see that the subject is lit, and the rest of the scene gets much darker than in the automatic mode. You've got the photo, but you can also raise the ISO or lower the shutter speed to better light the rest of the scene -- which is effectively what the camera was doing in full auto mode to take the photo.
Indoors, I often shoot at ISO 800-1600 with flash specifically to get the rest of the room bright enough to make out some detail. I also use an external flash (Nikon SB-900) which has much more power than the built in flash. In the case of your situation, f3.9 is the extreme end of aperture you can use at ISO 100 and 18mm focal length; the external flash will let me shoot at f5.6 or f8 at ISO 100 and 18mm, for example.
When in Shutter Priority/Aperture Priority/Manual
You can set the ISO to a lower setting via the shooting menu
While in shooting mode press the minus zoom and change the iso in there.
The issue with auto iso is, that the DSLR will choose a high iso to ensure the shot is correctly exposed - you could try adjusting exposure compensation to see if that changes the iso the button looks like a +/-
Auto-iso is not an exact science and your leaving a lot of decisions up to the camera.
Of course it does, but not if you are shooting at F22 and/or if "indoors" is a sports arena.
More details, please. What settings are you using? What is the distance to the subject? Is the subject wearing all black with a black background? etc.???