My toenail is only attached on one side. I taped it down because snagging it hurts. It is getting black from underneath. There is no pain, discharge or odor. Could it be fungus?

Could be. Although it could be fungus, the loose nail must come off. To leave it attached can cause pain and be a source for infection. See your doctor for a referral to a specialist to remove the loose part of the nail. It should grow back after removal.
Toenail. You might be describing old blood from trauma to your toe. A visit to your podiatrist will repair the nail and explain exactly what it is.
First. The nail needs to be removed. It could be a subungual hematoma and possible fungus. See your local podiatrist for diagnosis and treatment.