Please bear with me a bit while trying to explain my question as best as I can. I am a 4th year medical student so my command on chemistry is not too good, but I find it fascinating and intriguing, it is like magic.
My question is as follows:
How do scientists actually know the exact composition of a compound e.g. Caffeine ($\ce{C8H10N4O2}$), how do they exactly know that it has this exact amount of hydrogen or nitrogen atoms in a single molecule?
After knowing that, how do they know the precise geometry of the molecule (here I mean the hexagons and pentagons and how they connect).
And one last thing, how do they know the exact geometry and sequence of atoms in an enzyme?