If the bug is flat and looks like a green pepper seed, it is probably a bedbug. Other black bugs that may be located in the mattress include ants, which have legs and three sections, and fleas, which jump when they are being pursued.
Both fleas and bedbugs leave waste that looks like dirt in the crevices of mattresses. Ants do not leave any determinable waste.
Bedbugs often leave trails of itchy welts in a straight line on the skin, especially on the arms and legs. Fleas leave random patterns of bites on the body that resemble small mosquito bites.
Fleas can be treated by vacuuming the bed area thoroughly, then treating the mattress with a spray that contains an insect growth regulator. Ants can be vacuumed, then ant traps can be placed around the bed. Bedbugs can be removed by hiring an exterminator to thoroughly spray the area.
If you are being bitten by bugs in your bed, do not start sleeping on the couch or at a friend's house. Because you are the food source, the bugs will follow you.