Earnshaw was born in Ilkley, West Yorkshire. His father, a watchmaker and jeweller, died before he was born. His mother ran the family shop until bankruptcy in 1930, when they moved first to Redcar and then to Leeds. There, Earnshaw attended Harehills School until the age of 14.
He worked as an engineering fitter, later as a lathe turner and a crane driver, while educating himself at the city library. At 20 he became interested in surrealism and, with his lifelong friend Eric Thacker, devised surreal activities such as boarding and alighting from trains at random. In the early 1960s he met several like-minded people, including Patrick Hughes, Ian Breakwell and Glen Baxter. Hughes persuaded Earnshaw to hold a retrospective at the Leeds Institute in 1966, which was followed by an exhibition in Exeter, The Enchanted Domain, to which he was invited by John Lyle.
He began teaching part-time, first at the Harrogate School of Art, then Bradford Art School before leaving engineering altogether in 1972 to take up a fellowship at Leeds Polytechnic. He left in 1985 to concentrate on art.
In 1968 he collaborated with Thacker on an illustrated novel, Musrum, which - although not particularly successful commercially - became a cult classic. The book was a fantasy, peppered with aphorisms ("Sudden prayers make God jump"), and told the story of the title character's kingdom and of his battle with the nefarious Weedking. It was followed in 1971 by a sequel, Wintersol, about the secret criminal nature of Father Christmas. Both books were praised for their elegant writing, wit and wordplay, and especially for their sheer invention.
Later publications included a cartoon in the Times Educational Supplement, a wheeled bird named Wokker, and books of aphorisms, the largest being Flick Knives and Forks in 1982. In the 1980s and 1990s Earnshaw began making art boxes, further exemplifying his surrealist bent.
Earnshaw died in 2001, survived by his second wife, Gail, and by two daughters from his first marriage.