A lot vs. Alot: 9 Grammatical Pitfalls
"tamed animal," originally in Scottish and northern England dialect (and exclusively so until mid-18c.), of unknown origin. Sense of "indulged child" (c.1500) is recorded slightly earlier than that of "animal kept as a favorite" (1530s), but the latter may be the primary meaning. Probably associated with or influenced by petty. As a term of endearment by 1849. Teacher's pet is attested from 1890. Pet-shop from 1928.
"peevishness, offense at feeling slighted," 1580s, in phrase take the pet "take offense." Perhaps from pet (n.1) on a similar notion to that in American English that gets my goat, but the underlying notion is obscure, and the form of the original expression makes this doubtful. This word seems to have been originally a southern English term, while pet (n.1) was northern and Scottish.
positron emission tomography