According to Plato, Socrates said that the unexamined life isn’t worth living, a dictum that Bryan Sipe might have had in mind when writing “Demolition,” which is essentially about a man deconstructing his existence—all too literally—after the sudden death of his wife. As scripted by Sipe, directed by Jean-Marc Vallee and acted by Jake Gyllenhaal, the story is a sometimes amusing, sometimes poignant one. But whatever the tone of the moment, it’s consistently quirky—which is both a strength and a weakness.

As the film opens, Davis Mitchell (Gyllenhaal), who works in the Wall Street investment firm of his father-in-law Phil (Chris Cooper), is driving into the city with his wife Julia (Heather Lind) at the wheel when their cars is struck from the side. He gets away with scratches, but she’s rushed to the hospital, to no avail. Her loss sends Phil and his wife into deep grief, of course, but its effect on Davis is curious. He shuts down emotionally, and becomes fixated on a vending machine in the hospital emergency room that didn’t operate properly when he tried to buy some candy from it after his wife’s demise. He writes a letter asking for a refund, but tells his story in excruciating detail, in effect employing it to begin an effort to follow Phil’s advice to take his life apart piece by piece in order to reassemble it with a fresh start.

But that effort takes a strangely literal tack. Davis begins to speak with absolute honesty, confessing his lies and even abruptly announcing to a near-stranger that he didn’t love his wife. But he also starts disassembling material things—a leaky refrigerator, a malfunctioning light in Phil’s home. And his unraveling of his life continues in more long letters to the vending machine company. Eventually they get a response from the sole customer service person at the place—Karen Moreno (Naomi Watts), a single mom whom he eventually seeks out in person. That leads to increasing involvement with her and her trouble-making adolescent son Chris (Judah Lewis). The kid has been acting out in dangerous ways, and develops a bond with him. His intervention rouses the ire of Karen’s boss (and boyfriend) while making Davis a confidant of the boy, who’s been struggling with some significant personal issues by himself until then.

Meanwhile Davis carries his disassembling to a simply destructive stage. He volunteers to help a wrecking crew smash an old house to smithereens for nothing—a decision that costs him more than a little physical discomfort. Eventually he enlists Chris’ help in tearing down the modernist house he and Julia called home, at one point even renting a bulldozer to finish the job. The weird behavior causes Phil to force Davis to take an extended leave, especially after he refuses to act responsibly when Phil sets up a foundation to give scholarships to exceptional young people in his daughter’s name.

Throughout all this, Vallee uses a variety of cinematic techniques—including periodic ghostly images of Lind—to portray Davis’ inner struggle, and Gyllenhaal throw himself into the character, embracing Davis’ strangeness with gusto but also endowing him with a sympathetic quality. As his connection with Karen, and even more with Chris, blossoms, he grows less stiff and more emotionally open, even if some of his outings with the boy—particularly one involving guns and a bulletproof vest—stretch credulity to the breaking point. Watts and Lewis score as well, the former offering a nicely reserved turn and the latter showing real spark as a kid with a chip on his shoulder that proves heavier than he can bear. Cooper, meanwhile, captures Phil’s grief-turned-to-anger with his customary professionalism.

Unfortunately, “Demolition” takes a turn for the worse in the third act, when Davis begins to come back from his oddball self-examination and starts embracing normalcy again. His difficult rapprochement with Phil is handled fairly well, even if it’s marred by an off-tone reception sequence complete with a melodramatic revelation that comes out of left field. A graveside scene opts for mawkishness. An episode that takes Davis back to the hospital goes for the jugular in a way that seems obvious and rather banal. And a final decision by Davis to engage in rebuilding something is portrayed with a very heavy hand, especially since Vallee and cinematographer Yves Belanger choose to bathe the resultant scene in a heavenly glow that screams redemption.

Nonetheless if “Demolition” doesn’t escape a feeling of metaphorical overkill even before the manipulative excesses of the final half-hour, it affords Gyllenhaal the opportunity to etch another portrait in his gallery of eccentrics that goes back to “Donnie Darko.” It’s a bumpy, uneven ride, but there are nuggets to be enjoyed along the way.