The Color Replacement Tool replaces color you paint on with foreground color without painting over image detail.
In the Toolbox, select the Color Replacement Tool.
On the Options bar, set brush size and style.
Paint to replace a color.
In the Options bar, you can choose a sampling mode:
"Continuous" replaces all the colors with the foreground color.
"Once" only allows to replace color, that you first click on; for example, if you start a stroke on a red area the tool replaces only red pixels.
"Background Swatch" only replaces pixels containing the current background color.
Also on the Options bar, you can define blending mode, Tolerance (the tool's sensitivity) and Limits - the tool's range: all over the image (Discontiguous), only the adjacent areas (Contiguous) or the pixels inside only (Find Edges).
Tip. Just in case you didn't know, the Color Replacement tool is also available in Photoshop Elements that is way cheaper version.
And if you believe, Photoshop Elements lacks some other important feature, be sure to visit this page.