Evariste Galois is one of the true tragedies of mathematics. The romantic version of the story is that he frantically wrote down his mathematical discoveries the night before his certain death in a duel with one of France's best duellists. Indeed, he died at 21 in this duel. It isn't clear what the duel was over: a woman, or politics. The truth is that Galois had already detailed his work months earlier in a manuscript he had already sent to the best French mathematicians. "Galois theory" is still the subject of active research in modern mathematics.
Another tragic early death in mathematics was that of the Norwegian mathematician Niels Abel, who made several spectacular discoveries (some related to the math Galois also worked on) before his death at 26 of tuberculosis. Abel died in 1827; Galois in 1832.
If any of this interests anyone, there's a marvelous web site: The MacTutor History of Mathematics Archive
Ramanujan also (IIRC) learned all his mathematical formulas from dreams, the goddess of learning Saraswati revealed it all to him. He "reinvented" math that was already in existence, and presented formulas and theories that have not been proven yet.