This can be caused by the selected flash setting. If Flash Mode is set to Autoflash, the flash may not fire if the camera determines there is already enough light to create a proper exposure. Set Flash Mode in the Fn menu to Fill-flash to force the flash to fire every time you take a picture.
IMPORTANT: On some cameras the built-in flash needs to be pulled open into the upright position before it can be used.
NOTE: If model-specific information is required for how to pull open the flash or how to change Flash Mode, refer to the operating instructions supplied with the product. Manuals are posted on your model support page.
If the issue is still unresolved, service may be required.  Go to Product Repair.