The answer is not answerable with certainty BUT providing all available information initially helps people answer it better.
You say in comments that "I filmed a video just fine". Was that with this camera?
To people not accustomerd to the camera what you mean by preview and shoot is not certain to be clear. The following is based on best assumptions.
When I point the camera at a scene the rear LCD displays an image with the usual quality.
When I then take a still photograph of the scene the image is badly distorted.
When I video the same scene the recorded video is of usual quality.
Mentations:
It MAY be the memory card.
Trying another card is well worthwhile.
If you have already done so you should have said so and told us the results.
Video recording OK and still photos displaying on LCD OK but not recording to memory card correctly suggests that:
Sensor is very probably OK as still-LCD image is OK and video is OK.
Basic record interface is probably OK as video records OK. A fault which allows video recording and disallows still recording is possible but unlikely.
Central processing core (main IC and/or some related components) is likely to have suffered a failure relating to jpeg compression or similar.
As processor functionality core is intimately affected by program and as even a one bit error can cause chaos and doom and as the camera is ~=5 years old THEN reflashing seems very worth trying.
The chance of it being a broken wire or similar is small but possible. A failed electrolytic capacitor is also a possibility.
All or some of the above may be wrong.