The only way to know for sure if it’s a software issue would be to put your phone into recovery mode and restore it through iTunes. This will force iTunes to overwrite your previous iOS installation. Set it up as a new device (rather than restoring from a backup) and check to see if your camera and flash work again. If they don’t it’s likely a hardware issue. I have no clue how much that would cost but I’d sure that depends on what needs to be replaced, your geographic region, and where you take it for service.