Stain / residue on hardwood after years of rug covering
You can try cleaning the grime off (thats some of the carpet pad impregnated with dirt), but ultimately you should refinish the wood floor.
This involves a commercial sanding machine and other equipment not readily available.
To clean try and scrape as much of the crud off as possible using a putty knife or a paint scraper. try not to gouge the wood or remove the stain (this is the difficult part). Next you should use some type of floor cleaner. I think a good cleaning product is TSP. It's made for heavy cleaning. Fill a bucket with hot water and mix in the appropriate amount of TSP. Wring the mop out so the floor isn't saturated with water and apply. Scrubbing with a bristle brush will help. Repeat as needed.