I bought an iPhone that was water damaged and the camera didn't work at first, same description as yours. Check your water sensor in the bottom of your headphone jack with a bright light. If it is Red/pink, then your phone has been water damaged.
As for replacement, if your phone has not been water damaged, restore in itunes before taking it in to Apple. Restoring the phone erases the Jailbreak so nobody will ever know (except you).🙂