"We are all sick in our own way," Felix Quinn declares. Felix Quinn is the hero of my new novel, The Act of Love, and he, admittedly, has an axe to grind. He is a cuckold and he likes it. His idea of a good time is lying lonely in his bed, knowing that his wife is out on the night, enjoying the embraces of her lover. This will be incomprehensible to some men, and not to others. But we shouldn't, where the daemon of sex is concerned, be surprised by anything. I don't always agree with the heroes of my novels but I agree with Felix: we are all sick in our way. In the erotic life of men and women there is no such thing as health.

A new book about Franz Kafka discloses that he was more than casually interested in hard pornography. Lovers of literature shudder inwardly, as they did when they discovered something similar about Philip Larkin, and as an earlier generation shook their heads in disbelief over Charles Dickens's indiscretions with women young enough to be his daughters. Though we want our writing muddied, we like our writers clean. But what else should we have expected of the author of The Metamorphosis and The Trial, those bleakly comic unforgiving tales of ignominy, guilt and shame? This is not to say that pornography is the only explanation for his temperament or the only route he might have taken to explore it, but it makes sense to me that such a man would have found something congenial to him - I don't say pleasant or even satisfying - in the act of perusing it. "The sense of the tragic increases and diminishes with sensuality," Nietzsche wrote. Meaning that the more the senses engross us, the more philosophically serious we become. It is an important formulation: we are philosophers by virtue of our sexual appetites, not despite them.

Pornography is not, of course, the only expression of sensuality, but some extreme sorts of sensuality tend inexorably in its direction. In its written form, pornography's only convincing conclusion is death, for ecstasy without restraint wants nothing less. Pictorially, too, in the mortuary fixity of its imagery it is essentially morbid, refusing change of mood or flux of feeling. Either way, pornography is a trance, demeaning all parties to it, those looked at and those looking, locking them into a perpetuity of shame. There is nowhere to run to in pornography as there is nowhere to run to in the novels of Kafka. On the last page of The Trial, Joseph K watches impassively as the mysterious "partners" thrust a knife into his heart. "Like a dog!" he says. "It was as if he meant the shame of it to outlive him." That could be pornography he is describing..........

Download the new Independent Premium app Sharing the full story, not just the headlines

It is not, I hope, perverse of me to cite the above as prime among the reasons - along with what we owe to curiosity - why we should acquaint ourselves with pornography, in whatever form it takes. In its ominous nothingness, pornography familiarises us with humiliation and humiliation with despair and loss. And loss stimulates the imagination. Winning is a dead end, in sex as in everything else. It is only out of a keen sense of loss that we tell stories, write poems, and learn to liberate ourselves from damagingly misleading optimistic fantasies of sex as purposeful and joyous, whether purposeful in God's sense of procreation in the divine image, or in Darwin's sense of selecting what's best of us for futurity. Sex is for nothing, pornography teaches. Unless you call ignominy something.

When he wasn't looking at pornography or writing The Trial Kafka visited brothels, which if you like is just putting pornography into action. I am glad for his sake and for literature's that he did. I feel about prostitution as I do about pornography - that a man ought to avail himself of whatever is on offer. Paid-for sex, in all its varieties - sex stripped of responsibility and sentimentality (though even with a prostitute it will not always be so simple) - answers to imperatives which respectable courtship and marriage prefer to ignore. Whenever I encounter a man who says he has never visited a prostitute, either because the thought appals him or, as is more commonly asserted, because he doesn't need to pay for sex, thank you very much, I believe that he is lying, or, worse, that he is a fool. Among the many reasons for paying for sex the most salient is the wanting to pay for sex; and that "want" is not to be confused with need. We know that from the examples of famously glamorous men who have all the women their hearts' desire but still routinely get caught - and who is to say don't hope to get caught - with a hooker in the back seat of their automobiles. All the women one needs do not satisfy the desire to pay for a woman one does not need.

So what does drive a man to pay for sex, when paying must negate so much of the romantic baggage and vanity with which sex is laden? Loneliness explains some of it, but the lonely are obviously needy, and we are addressing needs which are less apparent. Feminist opponents of the institution of prostitution see paying for sex as an expression, pure and simply, of male aggression. The man shells out to subject a woman to his will. I don't doubt that some men pay to feel in charge, though it's a paltry authority that must be bought and men of this sort will soon discover they can impose themselves more effectively (in their own eyes at least) through violence that doesn't cost a penny. Those who go on paying do so not to assert their masculinity but to demean it. It is an ironic or self-defeating transaction, an act of mockery and submission, a species of masochism whether the man asks the prostitute to beat and degrade him or not. Catherine Millett, author of The Sexual Life of Catherine M, says she took on promiscuity to show that sex is separable from feeling. This is nonsense. The attempt to find feelinglessness in sex is an ambition loaded with feeling. To those who aspire not to feel in the course of a sexual encounter, the attainment of the illusion of feelinglessness is exquisite.

Thus the nothingness one goes in search of in a brothel is, by the wonderful inverse law of eroticism, not a nothingness at all. Beyond a certain stage the stage at which many of us call time on eroticism and pour what's left of our desires into work or an allotment sex functions as an exchange of shame and power: merely functional procreation giving way to the longing to pass from person into thing, to be the instrument (or controller) of another's will, to be less (or more) than human.

"In the end," the great French philosopher of eroticism Georges Bataille wrote, "we resolutely desire that which imperils our life." Not accidentally, not half-heartedly, but resolutely. I do not say we want to die (though on occasions we think we do) but we want sex to take us as close to death as life allows, the paradox being - and this is a paradox which most sexual perversions celebrate, whereas love, sweet love does not - that we are never more alive than when we are staring into loss..........

Not quite true that love, sweet love does not. Allow love to be its own perversion and it too can take one to the precipice. This is the principle by which my hero Felix lives his life. Imperilled by love and the hold it exerts on him, he embraces the very thing he dreads - embraces it because he dreads it - which is his wife Marisa's infidelity. He is never more alive than when she is in the arms of another man. Othello is, of course, the same: a man energised by jealousy. The difference being that Othello doesn't know that jealousy energises him whereas Felix does. And here's a question: could it be that what appals us most when we descend to jealous rage is not the thought that we have been betrayed, but the kernel of sickly pleasure we discover in it? Is Othello, in other words, more disgusted by himself than he is by Desdemona? The question isn't only academic. Had Othello taken the Leopold Bloom route, or indeed Felix's, and fetishised his fears, might not things have turned out differently for all parties? I don't say happily, I simply say otherwise. Better, anyway, to be familiar with one's nature and accepting of its shameful depths, than to flounder hopelessly as Othello does. Though I accept that tragedy might still await the complaisant husband whose taste for cuckoldom demands ever more extravagant betrayal - a spiral from which the hero of my novel is unable, or unwilling, to break free.

Or is that the moralist in me talking? The masochism into which Felix hurls himself is without doubt self-destructive and tyrannical, but what is not. Perverted or obsessive sex lands up in an emotional cul-de-sac, rubbing at its single itch, finding pleasure only in the one thing endlessly repeated or exacerbated - more and more pain, more and more pornography, more and more visits to houses of ill repute - but that which we call respectability fares no better. When I was growing up it was common to hear husbands call their wives "mother". Whether this was an allusion to their own mother or the mothers of their children their wives had become I doubt they knew. Either way, the wife was locked into her role and the husband into his script. The endearments of the long happily married fulfil the same function, and in the narratives of their cheerful longevity one always detects the cruelty of opportunities foregone, disappointment, equivocation, compromise, and a haunted curiosity as though they know they will go to their graves with the majority of their questions unanswered. You cannot enjoy the consolations of calm if you are an obsessive: but nor can you attain the poisoned bliss vouchsafed to the dissolute and the deranged if you are cautious and well-adjusted. Sex lets no one off.

It is for this reason that we are fools ever to be censorious about the sexual lives of others. It is fair enough that a Catholic bishop should castigate Max Mosley for his romps with prostitutes dressed in pantomime military uniforms. Churchmen exist to excoriate the fleshly. But the rest of us have no business being superior. And no business laughing either. It's true that the banalities of life - the cups of tea, the prattle of the whores, our own sad bodies unflattered by the uniforms of fantasy - will always compromise our frenzied worship of the god Dionysus. But in desire tomorrow is another day; we wake to find Dionysus every bit as demanding as he was the night before. What's odd is not how Max Mosley passes his time away from motor racing administration but why more of us don't turn our hands to something similar, given the agitation of our curiosity. Which raises the question of where we draw the line between fantasy and fact. Felix acknowledges no such distinction - for him, to want is to do - but then a cuckold is the least dangerous of men. Other sexual preferences are more menacing. That Max Mosley, whatever he intended, was in some measure exorcising his family's ghosts, parodying (to erotic end) their ideology, it is reasonable to surmise; but how would we have felt about such exorcisms had they spilled into actual, un-negotiated violence? It is tempting to take the safety-valve view of pornography and fantasy and see them as licensed liberty, sex's version of carnival. But that consigns the erotic life to an eternity of pretence. And we cannot live forever in pretence. Some doing, outside the mind, is necessary. Thereafter, it is up to society to decide what it can and cannot allow to happen. The best eroticism can do against the law, in so fas as it has a choice in the matter, is to keep pushing the boundaries of the imaginable. We grow a little freer when we read De Sade's One Thousand Days of Sodom, though we know we cannot live up to its lawlessness. The imagination is an unbordered continent. In art, which is the province of the imagination, we do not judge as we judge municipally, as magistrates or policemen. Which is why, whatever our education and our civic institutions try to lull us into believing about the nature of desire, we must find the space to think, and where possible to act, rebelliously, refusing all attempts to confine us to the hell of the normative.

We are strange creatures, part angels of reflection, part beasts that claw the earth. It is too cruel that an accidental species as peculiar as we are should ever have been made to think there is a right way and a wrong way of conducting ourselves sexually, as though there were some divine pattern we were framed to follow. I don't say that giving ourselves over to the demoniacal, or just the deviant, will necessarily make us happy - why should it when it is so rarely happiness we seek in sex? - but the straight and narrow has never yet made anyone anything but miserable.

Howard Jacobson's new novel, 'The Act of Love' is published by Jonathan Cape (17.99)