Have you ever embarked on a relationship with someone you instantly found attractive, knowing from the start it would end badly? The same exhilarating but doomed sentiment is evoked on encountering the authorial voice of Let Me Not Be Mad, a debut non-fiction work by clinical neuropsychologist AK Benjamin (not his real name). He is erudite, funny and quite possibly (but not definitely) crazy. That is Benjamin’s own assessment and fear, hence his title.

Much of the book takes the form of a handful of neurological case studies, a form now reassuringly familiar thanks to books by writer-medics from Oliver Sacks to Suzanne O’Sullivan. “Michael” is the survivor of a skydiving accident that sliced “two cubed inches” off the front of his brain, as a result of which the “super normal, unimaginative” financier became “a compulsive surrealist”. “Jane” pleads for surgery to remove the offending part of the brain from where her epileptic seizures arise. A smiling child walks into Benjamin’s clinic, her “steps uneven, leaning to her right side, gait too wide”. Her mental capacity has become diminished after a huge TV slipped its wall mounting and crashed down on her head.

But after just a few pages of dazzling writing, this book’s form changes, and it begins to seem not really a set of case notes after all, more the mischievous jottings of a cartographer, mapping the neural connections of his own disturbing thoughts.

In medical practice, cold, professional detachment is no longer the default position. Yet unlike Benjamin, most physicians still don’t tend to meet their patients for dinner or join them at football matches. At the end of a consultation to consider whether a patient’s severe epilepsy qualifies them for surgery, practitioners don’t usually have to stop themselves from blurting out: “Let’s just give her what she wants.” The reader soon appreciates that Benjamin doesn’t believe in the boundaries usually observed by medics.

Let Me Not Be Mad is full of the provocative reflections of a discontented, challenging mind. Benjamin is concerned, above all, with exploring the disappearing line between the neurological and the psychological, and the changing relationship between physician and patient. These are compelling ideas that intrigue the author and then terrify him. What if all of the patients bundled together are really a composite of AK Benjamin? He is the kind of physician to whom, halfway through your visit, you might glance up and say: “Doctor, have you looked at yourself recently? What’s wrong?”

In one passage, in a confessional whisper, he describes himself as being attracted to a patient – “butterflies, heart rate trilling ... hands trembling, thoughtlessly mirroring her posture, sculpting sympathy from the body’s clay”. He yearns to pass off her dementia, as she does, as a reflection of her charming ditziness.

When Benjamin looks in the mirror he sees a blur, as if he had sat for a portrait by Francis Bacon

Benjamin delights in demonstrating how medics’ often titanic certainty conceals a fear of being doubted. It is underpinned by a reluctance to accept the discipline as imperfect. In this book, the medical curtain is pulled back and our stand-in for the avuncular Sacks is revealed to be a bluffing circus ringmaster with a megaphone. Time and again, Benjamin is assaulted by “the familiar feeling of a patient slowly disappearing and my powerlessness to do anything more than recognise it”.

Benjamin’s self, too, is disappearing. When he looks in the mirror he sees a blur, as if he had sat for a portrait by Francis Bacon. As the book progresses, it becomes clear that a tragedy of mania and mental illness is unfolding – it takes him 10 minutes to button a shirt. His marriage falls apart; he is undone by the demands of his profession and by his paralysing knowledge of the fragility of the self. Initially, he seeks respite and refuge in extreme sports and dating apps. Eventually, he checks himself into a retreat in an attempt to achieve a calming of his mind. His therapist suggests: “Your thinking gets in the way of knowing.” Benjamin tries to calm down, but on Day 37 he confides to his diary: “Still writing although it’s prohibited, still the same urgent, undirected prolixity, the need for words, words, words.”

Insanity has often been depicted in literature as a descent – a one-way ticket to a mental underground. But in considering the subject while he is himself in the midst of madness, honestly portraying and displaying it with great humour and skill, Benjamin achieves a miraculous feat of psychiatric mountaineering. Among his achievements is to write a book that itself performs the encroachment of mental ill-health, as it skips between transparency and a rising mania-fuelled obfuscation. The author still manages to be a reliable witness – just.

• Let Me Not Be Mad: A Story of Unravelling Minds is published by Bodley Head (£16.99). To buy a copy go to guardianbookshop.com or call 0330 333 6846. Free UK p&p over £15, online orders only. Phone orders min p&p of £1.99.