The Third Policeman, by Flann O'Brien
Flann O'Brien was a pen name for Brian O Nuallain (O'Nolan) -- he seems to have had a few. He was born in 1911 in an Irish-speaking home, where his father was reluctant to send the children to an English-speaking school; they could all speak English just fine, and he preferred that they be taught in Irish, but such a school was not to be found. O'Brien became a comic, satirical writer -- and he drank a lot -- and The Third Policeman was his last novel, written in 1939 but not published until 1967, after his death. The blurb on the back cover says O'Brien was "one of Ireland's great comic geniuses" along with Joyce and Beckett.
The narrator, who never gets a name, is a young man, a fanatic scholar of the great philosopher de Selby, and he's going back to the family farm after university. He's an orphan and the farm is run by one John Divney, who suggests they remedy their lack of money by killing and robbing Mathers, the local miser. The narrator ends up in a conversation with Mathers' ghost, and then enters a two-dimensional police station, where two officers interrogate him about bicycles, teach him Atomic Theory, and plan to hang him for murder. Also eternity is down the road a little ways, and the narrator has conversations with his soul, whose name is Joe. The whole narrative is punctuated by long footnotes about de Selby's discoveries and writings, and in the end the narrator goes to find Divney...
I did not exactly find this novel to be comic or funny. It's surreal and weird and odd, and interesting, but I wouldn't call it funny. Maybe I don't have the right sense of humor. I liked it fine, and I do think it fits with Beckett. I haven't read enough Joyce to be able to compare (and my knowledge of Beckett dates from college and is rusty).