“Dead ringer” means an exact duplicate.
The two words appear to have nothing in common. So, we must deal with each separately.
“Ringer” is slang for a look-alike horse substituted for another in a competition or sporting event, in order to defraud the bookies. This meaning originated in the US horse-racing world at the end of the 1800s. The Manitoba Free Press defines it for us in October 1882: “A horse that is taken through the country and trotted under a false name and pedigree is called a ‘ringer.'”
“Dead” is commonly used to mean lifeless, but has several other meanings. The one that applies here is “exact” or “precise.” This meaning is demonstrated in many phrases, such as: dead shot, dead center, dead heat, dead right, and dead ahead.
So, “dead ringer” is literally an “exact duplicate.” The earliest print reference to the phrase appears in the Oshkosh Weekly Times, June 1888.
The word “ringer” also appeared in an 1877 issue of The Spirit of the Times, a New York sporting newspaper, to mean a person responsible for the switching of horses.
Two additional extended senses of “ring” are worth mentioning. These have to do with the opposing notions of (1) authenticity, and (2) fraudulent substitutes. For example, when we speak of a statement that’s convincing, we say it has the “ring of truth,” an expression the OED dates from the 1840s.
Occasionally someone puts forward, on the internet, the idea that “dead ringer” refers to people who were prematurely buried and who pulled on bell ropes that were attached to their coffins in order to attract attention.
Wrong! Anyway, if the ringer is dead, he can’t pull a bell rope, can he?