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.
By playing around with my D5100, I found that if you shoot in PROGRAM (P) Mode, not AUTO mode, and pop the flash up, it will (under normal conditions) leave your ISO where you set it (like, say, 200). It sets the exposure time at 1/60 and the aperture at f5.3. You have to set the white balance manually, though. I actually find the color balance is most accurate if I use "shadow of a house" color balance mode. After you focus and when you push the shutter button, it shines a beam of light first before actually taking the picture. It might use this to determine how long to flash the flash (this is usually less than 1/60 sec I believe, but I can't verify that). This way I get a nicely exposed picture with low grain noise. Weird how, in AUTO mode, on the same scene, it selects just about the same 1/60 (nominal) exposure and f4.8, but gives me a grainy image at ISO 1600. Here I do not have to (or even GET to) reset the white balance (and I don't like the color as well), and it seems not to send that beam of light first either. Seems it can only be choosing to fire the flash at a lower power, or for a shorter time, in AUTO mode. Overall AUTO mode seems like a good thing to avoid if possible.
I believe that the D5100 was one of the first Nikon DSLR models that started limiting Auto ISO with flash to increase only two EV in dim indoor light. So if Auto ISO is increasing to 1600 with flash, that would imply you have Minimum ISO set to 400? You could set ISO 100 as Minimum.
And you can of course simply set Auto ISO off, certainly for flash.
Nikon DSLR at first (the models the first few years) never allowed Auto ISO to advance at all if a TTL flash was detected present. That really works best with flash.
Then about 2009, starting with the D300S model, that old plan was abandoned, and Auto ISO was allowed full range with flash. Auto ISO is set for the dim ambient, and the flash had to work into whatever settings it discovered, becoming balanced fill flash for the dim ambient. But the ambient light indoors was often orange incandescent or green fluorescent, mixed white balance.
But that only lasted about one year before reconsidering it, and the D5100 was (I believe) one of the first newer models that would limit Auto ISO to only 2 EV increase if TTL flash was detected present. For example, 2 EV would be ISO 100 to 400, or 400 to 1600. But if not satisfactory, you can always turn Auto ISO off.
I could be mistaken, and the D5100 might still be one of the previous models that allowed Auto ISO full range of increase, even with TTL flash. But I'm really thinking it limits Auto ISO to 2 EV if TTL flash is used.
On any model, Auto ISO is not allowed to increase at all if a Manual mode flash is detected. Manual flash cannot react to ISO changes.