Well there are multiple technologies doctors use. You're probably familiar with the fMRI (fundamental magnetic resonance imaging) technique that measures brain activity. The fMRI works by detecting changes in blood oxygenation, since when the brain is more active more oxygen is used. --- Another one you might be familiar with: a CT scan (computed tomography). It's like an xray for your brain. You sit in this hallow cylindrical apparatus, then you get all sorts of xray beams to your head. The imagery you get depends on the absorption of the beam through the tissue that passes. --- Then there's EEG, or simply put, <span>Electroencephalography. You know in TV shows where scientists put those weird white sticker things on people's heads? Its that. The white sticker things are called electrodes and are only placed on the scalp, and it measures electrical activity. Its non-invasive, so it's frequently used for experiments. </span> I hope these helped somewhat
Accidents: Every so often someone gets smacked in the head REALLY hard and from their injury we learn about the brain. The most famous case occurred in 1848 to a fellow named Phineas Gage. Phineas was working on the railroad when an iron pole shot through his head. Lesions: A lesion is the removal or destruction of part of the brain. Doctors will lesion a patients brain during brain surgery. By removing parts of the brain we are able to learn what different parts of the brain do.