I am just two and two, I am warm, I am cold,
And the parent of numbers that cannot be told.
I am lawful, unlawful — a duty, a fault,
I am often sold dear, good for nothing when bought;
An extraordinary boon, and a matter of course,
And yielded with pleasure when taken by force.
William Cowper (1780)
Note: I’ve provided the answer in the Comments
Behind the lines
William Cowper (pronounced Cooper) had severe bouts of depression throughout his life, but the answer to the riddle is not typically thought of as depressing.
Cowper (1731-1800) was a poet and hymn writer and his most famous hymns are, “There Is a Fountain Filled with Blood,” “O For a Closer Walk with God,” and “God Moves in a Mysterious Way.”
He was good friends with John Newton (1725-1807) and included this riddle in a letter he wrote to him. Their joint hymns project, famously known as the Olney Hymns, produced the three above along with the most popular hymn of our time, “Amazing Grace.” The entire collection is available for free. Click here to download it as a PDF.