Antecedents: 'Are we not men?'
Questions along the lines of "Are you a man or a mouse?" or "Are we mice or men?" rarely appear in Google Books search results until the early twentieth century, but they have antecedents in rhetorical questions that go back much farther. Insistence on the special status of humankind is no doubt ancient, and rhetorical questions referring to that special status are quite old as well. For example, Fairburn's edition of The wonderful life and adventures of Three Fingered Jack, the Terror of Jamaica (1828) includes this outcry by Makro, a recently enslaved African, against slave markets:
'Are we not men?' did he cry; 'men as ye are? We vary in nothing but colour; we feel as you do, and are awake to the same sense of pain; but still are we disposed by and among you like cattle.'
The same notion is evident in The Merchant of Venice (by 1598), in the speech in which Shylock justifies his desire for revenge against Antonio:
Hath not a Jew hands, organs, dimensions, sense, affections, passions?—fed with the same food, hurt with the same weapons, subject to the same diseases, healed by the same means, warmed and cooled by the same winter and summer as a Christian is? If you prick us, do we not bleed? If you tickle us, do we not laugh? If you poison us, shall we not die? And if you wrong us, shall we not revenge?
In my view, this assertion of humanity (expressed as a rhetorical question) is one antecedent for the wording that the OP asks about. The longstanding, explicit contrast in idiomatic English speech and writing between mice and men is another.
Antecedents: 'a man or a mouse'
One of the links brought up by the search for the phrase "man or a mouse" cited in a comment by Hot Licks above is to this entry in James Halliwell, A Dictionary of Archaic and Provincial Words, Obsolete Phrases, Proverbs, and Ancient Customs, second edition, volume 2 (1852):
MAN. (1) Was formerly used with much latitude. Thus the Deity was so called with no irreverent intention. Forby tells us the East Anglians have retained that application of the word. (2) The small pieces with which backgammon is played are called men. "A queene at chesse or man at tables," Florio, p. 136. (3) A man or a mouse, something or nothing. See Florio, p. 44. ...
The Florio mentioned here is John Florio, who died in 1625, but who published a book titled First Fruits, which yield Familiar Speech, Merry Proverbs, Witty Sentences, and Golden Sayings in 1578. If that is the source of the phrase equating "a man or a mouse" with "something or nothing," then viewing the distinction between mouse and man as existentially crucial is very old indeed.
An echo of Florio's expression appears in a letter of May 1, 1712, from John Chamberlayne to William Nicolson reprinted in Letters on Various Subjects, Literary, Political, and Ecclesiastical, to and from William Nicolson, D.D. (1809):
When I wrote last to your Lordship, I was of opinion, with a great many others that have been made April fools, that the first of May would have produced some great event; but I was undeceived last week, and assured from my Lord Treasurer's mouth, at third hand, that the Mountains had made a wrong reckoning, and are not now to bring forth till about this day sevennight; and then, my Lord, if nobody gets the start of me, you shall be informed whether the production be a Man or a Mouse.
The usage here is metaphorical, as what Chamberlayne is discussing is an event that may prove to be something or nothing. But the phrase could also be used in an either/or way to indicate the two prospects that lay before a young person. From Beaumont and Fletcher [maybe], Love's Cure, or The Martial Maid (by 1615):
Lucio. Pray be not angry.
Bobadilla. I am angry, and I will be angry, Diabolo; what should you do in the Kitchin? Cannot the Cook lick their Fingers without your Overseeing? Nor the Maids make Pottage, except your Dog's-head be in the Pot? Don Lucio, — Don Quot-Quean, Don Spinster, wear a Petticoat still, and put on your Smock a' Monday; I will have a Baby o' Clouts made for it, like a great Girl; nay, if you will needs be starching of Ruffs, and sowing of Black-work, I will of a mild and loving Tutor, become a Tyrant; your Father has committed you to my Charge, and I will make a Man or a Mouse on you.
Another early sense of "a man or a mouse" seems to be as part of an axiomatic test of ignorance, like the ability to distinguish a hawk from a handsaw, or an ass from an elbow. From a record of the trial of William Scot in 1612, reported in Richard Challoner, Memoirs of Missionary Priests, and Other Catholics of Both Sexes, That Have Suffered Death in England on Religious Accounts, from the Year 1577, to 1684 (1741):
But as Mr. Scot perceived the judges were resolved to proceed, upon bare presumption, to direct the jury to bring him in guilty; he told them, he was sorry to see his cause was to be committed to the verdict of those poor ignorant men, who knew not what a priest was, nor whether he was a man or a mouse. Then turning himself to the jury, he said, It grieved him much that his blood was to fall upon their heads; but withal, bid them consider, for the securing of their own consciences, that nothing had been alledged against him but mere presumptions; and as he was not to be his own accuser, they were to proceed according to what had been legally proved, and not upon presumptions.
But actions that prove one to be bold or timorous could also be expressed in such terms. From "Terry O'Daly's Visit to the Chateau D'Eu," in Bentley's Miscellany, volume 14 (1843):
'Does your Majesty,' says I, seeing I was to be a man or a mouse, 'want a daycent honest boy to sarve you well, the divil a spalpeen of them all that would fire even a child's bownarrow at you would live five shakes to tell the story, if his brain-box was in the neighbourhood of my shilelagh, plaise your Majesty,' says I.
Likewise the older distinction between significance (or worth) and insignificance (or worthlessness) remained in play in later years. For instance, from "Epigrams of Martial, Part 1, Translations, Imitations, &c." reprinted in The Wit's Miscellany (1774):
Nothing or Cæsar," Borgia would be—True—
Since he's at once both "Nought and Cæsar" too!
... This Epigram gave occasion to the common Latin Proverb, "Aut Cæsar aut Nullus," that is, " A Wooden Leg or a Golden Chain," Or, "A Man or a Mouse," as We say ; tho' the original Latin one is certainly that, as in the Epigram, " Aut nihil aut Cæsar."
And from "The Resistless Foe," in The Anglo-American (December 6, 1845):
"... And, as to money lent on promissory notes, how are ye to know whether he who borrows it is a man or a mouse? It's often all promise and no pay. Now I'll not be fooled. I'll have what neither man nor devil can take from me,—I'll have that which will neither burn, nor waste, nor melt away,—I'll have land!"
The dichotomy between boldness and timidity appears—again, not as a question, but as a choice—in Evelyn Benson, Ashcombe Churchyard (1861):
"She [the cat] remains in the house." said Edmund, "and pats and tickles her victim to death."
"Then women do take a hint from her sometimes," remarked George.
"But it depends on ourselves," said Campbell, "which one we choose to be, 'men or mice'!"
A review by John Manly of of Brandl's Quellen des weltlichen Dramas in England vor Shakespeare in The Journal of Germanic philology, volume 2, number 3 (1899) sums up the background on "a man or a mouse" as used in English:
A man or a mouse is a proverbial expression to express risk or encourage a person to be daring. The idea is 'Be a man, or else don't pretend to be one but admit that you have what Chaucer's Pandarus [in Troilus and Criseyde (by 1386)] calls "a mouse's heart."' See [The] Schole-House of Women [1541/1572], 385 ff. (Hazlitt, [Remains of the] Early Pop[ular] Poetry [of England] 1V, 119–20):
'Fear not, she saith vnto her spouse.
A man or a mouse whether be ye?'
Cf. 'It is but haphazard, a man or a mouse,' Apius and V[irginia] [1563/1575], Dodsley, XII, 356.
It thus appears that explicitly asking a person whether he is a man or a mouse goes back at least as far as The Schole-house of Women, which was published as early as 1541, and is quoted by Hazlitt from editions drawn from 1560 and 1572. Nevertheless, the (almost) exact wording "Are you a man or a mouse?" doesn't appear in Google Book search results until a flurry of references to the following joke (taken here from The Literary Digest (May 13, 1905), which cites the Cleveland [Ohio] Ledger as its source:
MRS. PECK (contemptuously): "What are you, anyhow, a man or a mouse?"
MR. PECK (bitterly): "A man, my dear. If I were a mouse I'd have you up on that table yelling for help right now."
And the first exact match for "Are you a man or a mouse?" appears in The Railway Maintenance of Way Employes Journal (September 1921):
Trinidad, Colo[rado], Lodge 204.—Are you a man or a mouse? By observation I have noticed that the man who of his own free will and accord, becomes a member of a labor organization, pays his dues promptly and attends meetings regularly, is a man. He can always be depended on for any duty that may be required by the lodge.