Any disturbance to the mold spores will release them into the air. They require, moisture, no air movement and darkness to grow. You have to elimiate the environment they like to grow in. The most likely culprit is the padding under the carpet. There are commercial companies that do mold remediation and there are also special cleaners to kill mold. Do not scrub with anything but a mold product, you will just spread the spores. Wear protection for your respiratory system, eyes and skin. Tear out the carpet and padding and discard it. If you see no signs of mold on the floor under that, clean with a mold product while wearing your protective gear. Let a fan run to move the air, after cleaning, and make sure everything is throughly dry before recovering the floor. You can also open all blinds, etc to let light in and place a dehumidifier in the room. If there is mold in the wood after lifting the carpet and pad, tear wood out and inspect lower walls for moisture and mold. Continue going until you have only dry wood.