The most common, least invasive way to diagnose lactose intolerance is through breath testing. Breath tests require you to arrive fasted at the testing facility, usually a gastroenterologist's office, and to drink a standardized dose of pure lactose diluted in water. Then, every 15-30 minutes over the course of three hours, you will breathe into a bag so that your breath can be tested for the presence of gases that would indicate bacterial fermentation of the lactose you consumed.
If you are lactose intolerant and therefore cannot absorb lactose, then the lactose you consume during the test should be fermented by gut bacteria when it arrives in your colon. Gases detected on your breath provide evidence of this fermentation, and thus evidence of your lactose intolerance.
There is also a blood test that some doctors use to evaluate lactose intolerance by measuring changes in your blood sugar levels before and after drinking a lactose solution to see whether you absorbed it digestively or not. However, because this is more invasive and expensive, it is a less common way to test for lactose intolerance.
For more information, visit:
Mayo Clinic - Lactose Intolerance Tests & Diagnosis