Is your lens dirty? Sometimes cleaning the lens with iKlear, Omnicleanz or another non-ammonia based LCD cleaner and a microfiber cloth will work wonders. If that's not the problem, then I would try doing the following in order:
1. Go to Settings - General - Reset - Reset All Settings. You won't lose any data but if you've spent a lot of time customizing your phone, you will have to do that all over again.
2. Do a hard reset- back up your phone to your computer or iTunes and do a restore- this wipes your phone. Try setting it up as a new phone.
If that doesn't fix your focus issue, you probably have a hardware problem- I would set up an appointment with a Genius and have them diagnose your problem. As long as they determine you didn't cause the malfunction (i.e. dropping it or otherwise), and you're reasonable and polite, they'll take care of you.