Dream inspired discoveries are  nudges from Pure Affection
The hitherto undiscovered molecular structure of the aromatic compound benzene, whose six carbon atoms are linked to form a closed ring, was finally revealed in 1863 to German benzene researcher Friedrich August Kekule, in a dream. His dream was of an ouroborous- a serpentine dragon clasping its own tail, in it's mouth, thereby yielding a closed ring. This is not a unique case. Many notable scientific discoveries, have stemmed directly from amazing examples of creative dreaming, as illustrated by this collection of examples. (excerpt from book )
The Periodic Table
The periodic table of chemical elements utilises the substances' atomic masses as the basis for classifying them into periods and groups. This universally accepted sysem of element tabulation was the brainchild, or should it be dream child?, of Russian chemist Dimitri Mendeleev, in 1867. After many unsuccessful attempts to create an accurate means of categorising the elements, one night, Mendeleev had a vivid dream in which the periodic table, that we still use today, was laid out in front of him, fully constructed. When he awoke, he could clearly recall the table's format and wrote it down immediately. In the following years only one value needed correction. Initially there were gaps, because some elements were unknown at that time, which exhibited Mendeleevs predicted properties, but all of those predicted elements were discovered in due course, including gallium, scandium, germanium in his own liftetime.
A fishy kind of dream.
A similar instance of "creative" dreaming was experienced by  swiss born  american paleontologist ProfessorLoius Agassiz. His major work, "Researches on  fossil fish", described  and classified more than 1700 species. During his exhaustive studies while preparing the book, he had profound difficulties in ascertaining the structure of one particular species. One night, however, he visualised it's structure in a dream ,but could not recall it.The same frustrating scenario repated the following night. The third night he had pen and paper ready.And the uncanny dream repeated. Happily he wrote it down as detailed in the dream.Although it seemed bizarre to look at, his continuing studies confirmed that the dreamed structure was wholly accurate.
Mendeleev dreamed an
unknown fish structure
A dream in time saves nine.
Now renowned as the inventor of the worl's first double-thread sewing machine, back in 1844, Elias Howe had experienced a year's worth of disappointments, in his attempts to design one.
Then, one night,  he dreamed a very odd dream, in which he was fiercely confronted by a host of belligerent warriors, armed with peculiar spears, bearing holes shaped like eyes. The image remained with him, when he awoke.Inspiring him to create the curved, eyed needle that became an integral part of his eventual stitching machine.
Eminent German physiologist Dr Otto Loewi was joint winner of the Nobel prize in 1936 for physiology and medicine.Honouring his discovery that the stimulation of one neuron (nerve cell) by another, is caused by a chemical substance (acetylcholine rather than entirely by electrical means.Loewi attributed his discovery to a remarkable dream in which he was presented with the design of a frog heart experiment to prove his theory of chemical neurostimulation.When he awoke he performed the experiment, exactly as he had witnessed , in the dream and duly confirmed his theory.
The dream that changed the course of WWII ?
Events in WWII may have followed a very different  path had it not been for a truly memorable dream experienced in 1940 by DB Parkinson, an engineer at Bell Labs. At the time he was engaged in designing a carded potentiometer for civilian telephones.
One night however, he dreamed a strange dream in which he saw his potentiometer put to a strange use. After watching an allied crew using an artillery piece to shoot down German aeroplanes with unerring accuracy. Parkinson was permitted to examine the gun, and found to his surprise, that mounted on the end of the exposed  trunnion, was his own potentiometer. Parkinson mentioned the dream to engineers at Bell Labs, who came up with a way of converting his dream into reality in the field of anti aircraft gun control. The result was the M9 gun director. As revealed in a New Scientist article 1997. A single weeks work at Bell Labs, was deemed responsible for destroying all but two V1 buzz bombs, launched toward England, from an enemy base near Antwerp.