Watson is called John H. Watson in the Arthur Conan Doyle stories except for a couple of times when he is called James. This puzzled scholars for years until Dorothy L. Sayers suggested the H stood for Hamish, the Scottish version of James. In the film Watson's middle name is Hamish.
The chess game between Holmes and Moriarty was based on a real match between Bent Larsen & Tigran Petrosian in 1966 in Santa Monica. The game had a Queen sacrifice and discovered checkmate to win the game. The opening moves are slightly different and the colors have been reversed though.
In 2003 Stephen Fry appeared on the UK quiz show Celebrity Mastermind. His special subject was Arthur Conan Doyle's Sherlock Holmes, including a question on Mycroft Holmes. He choose this topic because he loved Sherlock Holmes stories as a child and at the age of 10 was the youngest member of London's Sherlock Holmes Appreciation Society.
The opera that the characters visit in Paris is Don Giovanni, by 'Wolfgang Amadeus Mozart'. The scene being played is the finale of Act II. In it, the villain and seducer Don Giovanni is visited by the animated statue of one of his victims, who drags him to Hell when he refuses to repent.
The medals Watson wears during his stag party are the Afghan War Medal (red and green ribbon) and the Kandahar Bronze Star (multi-colored striped ribbon), which would make Watson a veteran of the Second Afghan War (1878-1880).
The text of the note that Holmes leaves Watson on the packing crate reads: "Come at once if convenient. If inconvenient come all the same". This quote is taken directly from Holmes creator Arthur Conan Doyle's book The Adventure of the Creeping Man.
The series of numbers on Moriarty's black board (and seen again briefly during the notebook decoding sequence towards the end) is Pascal's triangle with the shallow diagonals marked, the sums of which form the Fibonacci sequence.
At the end of the train sequence, Watson says to Holmes, "Once more unto the breach". This is a line from a speech in Henry V by William Shakespeare. Much later in the play's speech, Henry V also exclaims, "The game is afoot", which Holmes used as a catchphrase in Arthur Conan Doyle's stories.
The movie is primarily based on the short story "The Final Problem" by Sir Arthur Conan Doyle (and to a lesser extent on "The Empty House"), but also shows aspects from other Sherlock Holmes stories: "The Sign of Four" (introduction of Watson's fiancée); "The Greek Interpreter" (introduction of Mycroft Holmes); "Valley of Fear" (explanation of Moriarty's underworld empire); "The Speckled Band"; "The Dying Detective"; "Bruce Partington Plans"; and "The Second Stain".
In Holmes' final struggle with Moriarty, he uses a two-handed clasp to immobilize Moriarty before going over the falls. In the 1903 book "The Adventure of the Empty House" Holmes does not specify the specifics of the fight - but the illustrator of the book, Sidney Paget, drew Holmes in the same unique grasp that Robert Downey Jr. used in the film.
Sherlock defeats Moriarty by pulling him over Reichenbach Falls, with both of them falling to their apparent deaths; Holmes is later shown to have survived. In Arthur Conan Doyle's story "The Final Problem" (intended to be the final Sherlock Holmes story), Holmes defeats Moriarty in the same way, by falling over a waterfall to the apparent death of both. However, in response to overwhelming public demand, Doyle wrote another story and resurrected Holmes.