Quit out of any app that can access the iPhone camera – things like Camera, Instagram, Facebook, Snapchat, Afterlight, etc
Flip the iPhone over and apply very slight pressure against the physical camera hardware using a finger, it may depress slightly indicating this loose camera issue
Now try to use the Camera app as usual (from lock screen access, or third party app is fine), it should work fine now and take pictures as usual
So, a malfunctioning camera, no camera apps are working, and loose physical camera hardware on the iPhone? That clearly indicates a hardware issue, and whether or not it impacts many iPhone 5 users is not entirely clear.