It is in "Investigations of a Dog", I think, that Kafka, though he did not write science fiction, comes closest to writing science fiction. A-ha, you say, it's because here he writes about dogs who think and talk like humans do — an sfnal concept — and so surely by that logic a story about a man who wakes up one day transformed into an insect, or a story about a castle that does not exist in reality, or a story about a horse who becomes a lawyer: all of these are also sf! But no — I suggest that "Investigations of a Dog" is the closest Kafka — who did not write sf — comes to writing sf not because of the dogs in the story, but because of the dogs out of it. Kafka, who did not write science fiction, makes his closest approach to something recognizable as science fiction in five words in this story, five words that appear in the middle of a sentence in the middle of one of his famously long paragraphs. He writes:
They appeared from somewhere, I inwardly greeted them as dogs, and although I was profoundly confused by the sounds that accompanied them, yet they were dogs nevertheless, dogs like you and me...(Or at least, this is how the Muirs translate him.)
Dogs like you and me — this invocation and fictionalization of the reader — accusing the reader of being something they are not, something they cannot be, something closer to the work than is possible, in more ways than one — but at the same time it's true, it's correct, it is neither a lie nor, for the moment at least, a metaphor. If Kafka has anything in common with sf — which is not to say that he is sf — it's not that he calls the narrator a dog, it's that he calls the reader a dog.