If you mean you want to take an actual photo of a race, you view the replay, hit pause on the moment you want to take a picture of, click on the "Photo Mode" button, and then you can manipulate the camera and various settings in order to line up your desired shot, and then you can take the picture.
If you meant taking an actual in-game screenshot during the race itself, with all the gauges and race data as you're playing, I'm afraid I don't know.
Hope that helped.
EDIT: If you'd like some good pointers regarding taking pictures, this thread will certainly be worth a visit. I know I've learned quite a bit from that guide. Give it a look, if you have a moment.
An actual screenshot of what you see during a race can't be done in GT5, unfortunately. You'll need a capture card or some equivalent video recording device
I don't think it's possible, at least not within the game itself.
I suppose, if you were recording footage from the game onto your computer, you could probably take a still from the footage. I've never done so however.