What kind of exam would a doctor do to diagnose anal bleeding? Would it hurt?

Digital and anoscopy. In an 18 y/o, the likely cause of bleeding is either a fissure or hemorrhoids. Performing a digital exam or anoscopy, while uncomfortable, is not painful if this is hemorrhoidal bleeding while the same exam performed on a patient with an active fissure can be painful. Having said this, a fissure can be diagnosed by history and a simple good look with minimal discomfort.