First, a crash course in real-life runes: The runic alphabet is known as the Futhark (technically, the Fuþark) for the six first letters in the alphabet, and went through several changes; Personally I'm mostly familiar with the Elder Futhark (24 characters) and the Younger Futhark (16 characters).
The design of runes make them easy to carve into wood or stone, and though they initially were used by scholars, when the Roman alphabet was introduced to Scandinavia, the runes were claimed, as it were, by the lower classes. Runes were inscribed on pieces of wood and sent with thralls (a sort of early SMS), and we've found pieces like these saying things like "Gyda wants you to come home now" and "Ole likes to be fucked in the ass" (stay classy, vikings).
Also: The Futhark wasn't just used for writing. Each rune held powerful magic, and were for instance inscribed on sword hilts, ale cups, ship rudders - besides also being used for divination (inscribed on pebbles or pieces of wood).
And so back to mythology, and the origin of runes.
Knowledge and magic, that can only mean Odin had a part in it. In a section of Hávamál known informally as Rúnatal. It goes like this: Odin, always searching for knowledge, decided to sacrifice himself to himself.
Chew on that for a minute.
Sadly there's little context for this tale. Did he just want to find out what would happen? Was it for shits and giggles? Maybe that's another tale lost to us. But he says so himself: Gefinn Oðni, sialfr sialfom mer, "Given to Odin, myself to myself" (which, by the way, is one of my favourite lines from Hávamál)
How did he go about it? He hanged himself from "a windy tree" - probably the World Tree Yggdrasil, as "Ygg" is another name for Odin and "Yggdrasil" possibly means "Odin's horse" (those kennings again!). He hanged himself, wounded by his own spear (Gugnir, I suppose), and hanged there half dead for nine days and nights (nine being one of the more powerful numbers in Norse mythology, you might recall).
Sounds familiar? Brings to mind a divine guy from another religion, doesn't it, one who was hanged on a tree (or cross, if you will) and who endured it until "the ninth hour"? Weak White Christ; Odin suffered it for nine days.
(White Christ - Hvítakristr or in modern Norwegian "Kvitekrist" - was the vikings' derogatory name for Jesus Christ. Baptized converts wore white robes, and "white" was also viking slang for someone effeminate and cowardly ("lily-livered" is in fact derived from the viking term "to have a white liver"). In comparison, Thor was known as "Red Thor" - virile and violent.)
In any case, hanging on that tree, Odin peered down and "took up runes", possibly in a vision brought on by the pain. As he recounts it himself, opandi nam, "screaming I took them". And then he fell down, now aware of nine (or possibly eighteen, the sources vary) magical songs (galdr) and eighteen magical runes, to use for divination, healing and even necromancy.
And that's how Odin became aware of the first runes.
I like how almost every Norse myth helps you decode kennings, like why one of Odin's names is Hangatýr, "god of the hanged".
Also, this particular myth plays a large part in Neil Gaiman's wonderful novel American Gods. You should read it. Just throwing that out there.