Try to reset the device by holding the Sleep/Wake button and Home button at the same time for ten seconds until the Apple logo appears. Note: No data will be lost
Hope that helps
Try the reboot as suggested above, and if that dosnt work try restoring from an old backup.
Also, on one of my old iPods this happened because it got water on it. If there is a chance your iPhone got water in or one it or was kept in a damp place, put it in a bag full of uncooked (not instant) rice for 24 hours. The rice will pull all the moisture out of the device.