Keep your plywood subfloor healthy by taking care of little problems before they become big problems.
Squeaks and Creaks
You can often fix squeaks and creaks from underneath the subfloor, without having to pull up carpeting or hardwood floors. While you're below, have someone step on the squeaky area. You'll probably see that there's a small gap. Use a shim to fill it, then use a long woodscrew to anchor the layers of wood together. If the squeak occurs between joists, cross bracing will help eliminate the noise.
Stains and Odors
Pets and wall-to-wall carpeting are not always the best combination. If you notice that an ammonia smell remains even after you've shampooed the carpet, chances are that the subfloor has been soaked with urine. You can pull back the carpet and scrub small areas with household cleanser. Avoid bleach or lime, as both give off dangerous fumes. For larger areas, you'll need to plane or sand the wood to actually remove the stained material. When you've neutralized the odor and the affected area is dry, seal with two coats of polyurethane or a primer/sealer such as Kilz. Allow to dry and cure for several days before replacing the carpet.