Here’s a conceptual puzzle. Italian masters Paolo and Vittorio Taviani, filming convicts in Rome’s high-security Rebibbia Prison as they prepare to stage a performance of Shakespeare’s “Julius Caesar,” have made a film somewhere between documentary and neo-realist drama.

We meet the real inmate/actors, a band of drug runners and killers for whom Mark Antony’s refrain about “men of honor” surely carries Mafioso reverberations. The performances these hard men offer in their auditions for the play, and finally onstage before a civilian audience, are nothing less than riveting.

Salvatore Striano as Brutus, Giovanni Arcuri as Caesar and the rest sear the screen. Their emotions surge and break like monsoon waves; they are completely committed to the reality of their roles. Perhaps this should not surprise us. These are killers, drug runners and career con men, after all. Their livelihood depends on hoodwinking the gullible.

Equally engrossing are the playful offstage scenes when, we imagine, the men are off-script. Their feuds and anxieties, hopes and ego conflicts are almost as rich and crisply phrased as the Shakespearean disputes. Is this brilliant Italian ad-libbing, or a play-within-a-play a la “Hamlet” and “A Midsummer Night’s Dream”?

Some moments must have been staged. At one point a player testing the seats in the empty auditorium caresses a cushion and daydreams aloud, “Maybe a woman will sit on it.” Cosimo Rega, the play’s formidable Cassius, reflecting on the experience of reading, debating and performing Shakespeare, declares, “Since I’ve come to know art, this cell has become a prison.”

The Tavianis clearly illustrate the contrast between the actor’s absolute freedom and the limitations of penitentiary life. The film’s opening and closing sections, showing the prisoners’ triumphant performance, are shot in rich color. The stage, backed by scarlet curtains, is wide and deep enough to allow the men free range of movement. The long middle passage, in which the actors work with stage director Fabio Cavalli and one another to refine their characters, is done in lush, high-definition black and white. The rehearsal areas are constricted rooms with walls of raw concrete. It’s a thrilling moment when Antonio Frasca, playing Mark Antony, gives his eulogy over the fallen Caesar in the exercise yard, as an ad hoc chorus of inmates hoot for revenge from their onlooking cells.

The demarcations between life caught on the fly and performance are never clear. What is certain is how powerfully the actors, trapped in tragedies of their own making, relate to “Caesar’s” tale of deceit, betrayal and backstabbing. Are the prisoners seeing themselves in the mirror of timeless literature? Channeling their own antisocial passions into something of value?

The Tavianis, who have made dramas and documentaries as a team since the 1960s, refuse us the comfort of easy classifications. They understand that ambiguity and mystery are more interesting than certainty.

The final credits reveal each prisoner’s crimes, sentence and life history since their “Julius Caesar” was filmed. Two were motivated to write books. One, who earned a pardon, was inspired to become a professional actor. If you check his filmography to learn the date of his release, you will discover another of the Tavianis’ nesting surprises. “Caesar Must Die,” which won the Golden Bear at the 2012 Berlin Film Festival, is a box of tricks that keeps on giving.