I've heard from a bird that when you save in JPEG, you will always have terrible quality photos. But, I frequently see photographers post amazing photography on the web. I shoot in RAW, edit my photos, then save as JPEG and my photo looks very washed out, loses warm colors, etc. How can I save my photos for web-viewing without it looking awful?
You can't guarantee on the web that anyone else's screen will be properly calibrated, so worrying about the colours varying isn't going to get you far.
As to formats, JPEG works very well but make sure not to crank the quality down too low or you'll get a lot of artifacting. High quality JPEG images are quite acceptable to most people visually.
If you're creating smaller icons and don't want the compression artifacts from JPEG, try saving the same image in PNG format which is lossless and almost universally supported as well and check the file size. In some cases, it will be unacceptably large but it may also be worthwhile in others.
The method you use for saving your files will vary depending on the software you use to process your photographs. I take photographs using Canon EOS cameras and capture them in RAW mode with Adobe RGB color and I process them using Adobe Lightroom and Photoshop.
For publishing on the Internet DPI is not important, instead I focus on producing photographs that are sharp and high-ish contrast. I use Lightroom to output JPGs in the sRGB colorspace at full size for uploading to my SmugMug website and sometimes at smaller sizes for Facebook and Flickr.
My SmugMug site sells prints up to 30x40 inches so those JPGs are very lightly compressed and may be up to 10MB each while the Facebook and Flickr photos are reduced to 1000 or 2000 pixels on their longest side and compressed with a setting of 70 percent or so for files that are only 600k or so in size.
But on screen the highly compressed images on Facebook and Flickr do not differ much when viewed by the average person on a typical computer.
The real danger of JPG and any lossy file format is opening the JPG up in an editor and making changes to it then saving it again, then doing that multiple times. Every time the image is opened, edited and saved quality is lost and the lossy compression damages the image more and more.
In short, shoot in RAW at the highest widest colorspace available, only edit the image once, and save as JPG with the least amount of compression necessary for how the photo will be used.
Jpeg: Relatively small file size but a large amount of compression. One trick is to go to image -> image size -> and change image resolution to 72 pixels/inch. This will maximize the quality for file size output. If you were printing the photo resolution should be at best 300ppi to 100ppi, 300 being optimal and equal to the raw file you're familiar with.
Png: Best option in my opinion. Has no compression and relatively small file size. Best bang for your buck. Was designed to replace gif. File format therefore made for the web.
Tiff: Has large file size no compression. Good for archiving your shots.
Tga or targa: Has large file size and no compression but works best with video or film. Such as a timelapse or rendering out an animation from a 3d program.