Shooting in RAW vs JPEG
JPEGs are a compressed file format that is the most widely used and transferable image format. It is so popular as it is small and easily portable. JPEG files though are called a 'lossy' format though. They are called this as the JPEG file will slowly degrade in quality the more it is edited and saved. A RAW image though is exactly that. It is an exact copy of what the sensor of the camera detected at the time the image was taken. This means that the image data is stored fully allowing for later processing to be completed without degrading the images.
Most photographers including myself start out shooting in JPEG, because the files are smaller and you don't need a RAW editor to save and share them. However, RAW files store much more information, especially in the shadows and highlight areas, and allow for custom white balancing to be done. When shooting RAW, white balance, shadows/highlights, tone (contrast), sharpening, colour space, and exposure (to a limited extent) can be managed in your computer. An extra stop of exposure in the highlights and shadows can be recovered when shooting in RAW. Many serious photographers shoot in RAW, although a few excellent macro photographers mainly shoot in JPEG because they may not have time for RAW file processing.
So what are the main differences between RAW and JPEG file formats:
Saves all of the data from your camera sensor
Gives you more data to work with when adjusting color space, white balance, tone, exposure
Has 12-14 bits of color vs 8 bits in JPEG
Has a higher dynamic range
Needs to be converted to TIFF or JPEG to be displayed/printed
Larger file format
Can take camera extra time to write the file to the memory card
A RAW editor usually needs to be purchased, and upgraded for newer camera models
Sometimes needs contrast adjustment
Smaller format allows more photos to be stored on a memory card
Photos can be instantly printed or displayed on the screen / web and shared with others
Some recent dSLR's, such as the Olympus E-PL2, Nikon D300 & D7000, do an excellent job of noise reduction, sharpening, exposure control, etc. when creating a JPEG, saving the user time in post-processing
Difficult to adjust exposure, recover highlights, and change white balance
Lossy format means repeated saves slowly degrades image quality. Repeated changes can introduce types on noise known as JPEG artifacts
TIFF is another format. Data is stored in 8-bits, but there is no loss with repeated saves, and no compression. TIFF files can be very large, and people sometimes only store TIFF files if they have done extensive processing in Photoshop and want to save a lossy format.
I usually shoot in RAW + JPEG format. At first I only used JPEG files. Then I started processing RAW files more often, which took up a lot of time. Now I find myself being able to get great colour and exposure in my JPEG files, especially when shooting macro, and using them is saving me time. It is possible to get it "right" in camera. However, just in case I need it (and quite often I do), I always have a RAW file available for what I shoot underwater.
The big question - What's best RAW or JPEG?
It's really a personal choice. I suggest you try shooting one dive in JPEG, one dive in RAW. See if you feel that the additional RAW workflow is worth it to you. Try RAW first with some ambient light shots, that's where you will initially see the biggest difference in recovering contrast and some color, depending on depth. RAW + JPEG will be the answer for most intermediate and advanced photographers.
If you have a large enough memory card, and space on your hard drive (and most people will), and think you may ever want to sell photos, definitely shoot in RAW. Although it does slow the camera down quite often there is no point having a hundred photos that can't be edited if needed post shoot!
Keep in mind that all photos saved in RAW must be converted to a format such as JPEG eventually to display them on the web or to print them. Your photo editing tools can't re-write a RAW file, only your camera can do that. Some RAW editors will maintain a list of edits in a separate file however.