Can you get an ear infection by sharing the same headphones with somebody who has an ear infection?

Two types. Middle ear infections (otitis media) can not be transmitted since the infection is trapped behind the ear drum. If the drum has ruptured and fluid draining then wiping down the headphones is a good idea. External ear infections (otitis externa) the infection itself is in the outer part of the ear canal. Most likely the person won't wear headphones due to pain, but you should wipe them down.
Unlikely. Unless the ear infection is draining to the ear canal it is unlikely to have any infectious material on it. None the less you could wipe the earphones down with an alcohol pad if you were concerned.
Unlikely. Bacteria are naturally present in the ear canal. The mere presence of bacteria in the ear canal does not predispose you to an ear infection any more than bacteria on the skin. What needs to be present are the right conditions for an ear infectin: broken or "macerated" skin; moist environment; the right bacteria. If the combination of the above is not present - no infection (outer ear).