Your doctor may be able to tell if you have a nail fungus infection by looking carefully at your nails. He or she may scrape some debris from under a nail and look at it under a microscope or send it to a lab to determine what kind of infection you have.