Poet John Byrom, rhyming about the musical rivalry of the composers Giovanni Bononcini and George Frederic Handel, called them Tweedledum and Tweedledee:
Some say, that Signor Bononcini,
Compared to Handel's a mere ninny;
Others aver, that to him Handel
Is scarcely fit to hold a candle.
Strange! that such high dispute should be
'Twixt Tweedledum and Tweedledee.
This is apparently the origin of the terms, or the earliest known use. Possibly more commonly known is the use in Lewis Carroll's Through the Looking-Glass.