The Tempest was not in print until the 1623 Folio of Shakespeare's plays was published after his death.
Dates
The first recorded performance is noted in the Revels Accounts at court on 1 November 1611. It would have been unusual to risk a play's first ever performance before the king and so it is safe to assume that The Tempest had already been performed publicly.
Clues to a more exact date of composition come from a letter written by William Strachey describing the shipwreck of Sir George Somers during a voyage to Virginia. This letter clearly influenced Shakespeare's story of the storm and shipwreck and it could not have reached England before the beginning of September 1610, at which time Shakespeare could have read it in manuscript. (It was not published until 1623).
Other material relating to Virginia and Bermuda was published later in 1610.
All this makes late 1610 or early 1611 as the likeliest time in which Shakespeare wrote The Tempest. This is the same time at which The Winter's Tale was written.
Sources
The plot of The Tempest is original to Shakespeare but there are of course many influences and inspirations at work.
A shipwreck in Bermuda
Shakespeare's imagination was inspired by the shipwreck described in William Strachey's letter of 1610. In the same year, Sylvester Jourdain published A Discovery of the Bermudas. Jourdain had been with Strachey on the ship as it was driven off-course and shipwrecked in Bermuda, and his account exerted its influence on Shakespeare too.
A True Declaration of the Estate of the Colony in Virginia, published in 1610, was a report by the Virginia Company about its affairs, claiming land in America on behalf of the English Crown. While none of these three is a direct source of the plot of Shakespeare's play, there is no doubt that they were part of the cultural and intellectual climate which stimulated and influenced the dramatist's imagination.
Ovid and Virgil
The influence of Ovid's Metamorphoses is particularly evident in Prospero's description of his magical accomplishments at the beginning of Act 5.
Arthur Golding had published his English translation of the Metamorphoses in 1567 and there are many close verbal parallels between his translation of the witch Medea's celebration of her magic powers and that of Prospero. However, it is significant that this speech marks Prospero's renunciation of his magic while the murderous Medea is very definitely holding on to hers.
Ovid's dangerous witch can also be seen as an inspiration hovering behind Sycorax, Prospero's predecessor on the island.
Shakespeare takes his disguise for Ariel as a Harpy from Virgil's Aeneid, in which a flock of the ravening, monstrous creatures descend on a group of men in order to plunder their feast.
Montaigne
Montaigne's Of Cannibals, translated from the French by John Florio in 1603, is another clear influence on Shakespeare. Montaigne examines the contrast between so-called primitive societies and those that pride themselves on their civilization. Montaigne argues that the 'civilized' man condemns as barbaric that which he neither knows nor understands, while he is blind to the barbarities of his own society's customs of torture and cruel execution.
Jonson
Jonson's The Masque of Beauty can be identified as one of several contemporary masques whose influence can be traced in the betrothal masque and other instances of music, dancing and spectacular visual effects in The Tempest. Ben Jonson and Inigo Jones were the expert exponents of these elaborate court entertainments.
Other influences can be found in Spenser's The Fairie Queene (1596). In the sixth book of that long poem, Spenser writes of a savage language-less wildman but in this case, he is gentle and chivalrous towards women.