Hi, Terry. First, I would find out if the floor really is hardwood and what kind of wood it is. You might be a lot better off installing a good quality, refinishable, engineered wood floor.
In addition to the staining, you will have nail holes and staple holes from the carpet installation to fill. You will want to sand the old floor if it is worth saving after you do all the repairs before refinishing. I suggest that you call a pro and at least get a quote or 2 before you decide that this is a do-it-yourself project. The levelness of your old floor could be a big issue also.
If you do decide that you want to refinish your old floor, use oxalic acid for trying to bleach the black stains out. Oxalic acid is sold as Wood Bleach at your home center and you use the same directions from the package as for bleaching any other wood stains. The black stains can penetrate very deeply into the wood and be very difficult to remove.
The dust from Wood Bleach is very caustic to your lungs also so be sure to wear a good mask while mixing with the water. You will be creating a lot of dust when you sand your floors so you need a good mask for this also. You should buy a good mask with replaceable cartridge filters that is for working in dusty environments.
Search the board for other info on floor refinishing. The November, 1999 issue of The Family Handyman has great info.