Did Frodo take it off, or was the fell spider's sting simply too strong to be stopped by Mithril?
If it is the latter, that would be pretty surprising, because that would mean Shelob could possibly sting a sleeping dragon! (I remember Gimli saying "Mithril - hard as dragon scales!")
She stung him in the neck.
From "The Choices of Master Samwise"
She's got more than one poison. When she's hunting, she just gives 'em a stab in the neck and they go as limp as a boned fish, and then she has her way with them.
So the mail would not have protected him.
In support of DQdlM's answer [1], Shelob doesn't pierce Frodo's mithril chainmail at all.
While in the book she stings him in his unprotected neck, it's clear that this doesn't happen in the movie [2]! We see Shelob stinging Frodo from the front (since he turns to face her just before getting stung) and we can clearly see his neck is unhurt, so that's not the place. (As a bonus, we can see Shelob has a stinger, unlike real-world spiders. But that's neither here nor there).
However, I can still provide evidence that Frodo doesn't get stung through his chainmail. In this scene just minutes before his encounter with Shelob, we can see the mithril coat is actually way below his neck. Frodo's upper chest is unprotected!
Later we can clearly see at least two of his wounds: the wound from the Nazgûl, and the other must be Shelob's attack, within his exposed upper chest.
and
Which makes us wonder why Frodo didn't wear his chainmail in a more practical fashion.
Disclaimer: evidence gathered from the forums of TheOneRing.net [3].
[1] https://scifi.stackexchange.com/a/28370/Chainmail is composed of small rings, interlinked together. Against some piercing weapons it was ineffective. Arrows in particular could still injure the wearer. And since the monster would only need to penetrate it enough to inject poison (unlike an arrow that causes more injury the further it goes through), it doesn't seem that this would be much of an impediment to Shelob.
Shelob was no ordinary foe. It was of a "higher" (or lower) lineage than your average dragon. Recall that Shelob was the "last child of Ungoliant to trouble the unhappy world", where Ungoliant destroyed more or less everything that's fair in Valar (together with Melkor). Plus, a chainmail is not particularly effective against piercing weapons.
The Mithril only covers his torso, not his whole body, so unless it's explicitly mentioned where Shelob stings Frodo we have to assume that she gets an uncovered area.
The final draft of the script was much closer to the book than the final film; Shelob stings Frodo in the neck, rather than the shoulder:
CLOSE ON: FRODO suddenly senses the LURKING MALICE... he SPINS AROUND: Before he can react, SHELOB VICIOUSLY STABS FRODO in the NECK with her monstrous abdominal STINGER!
As far as I know there's been no official comment on why this was changed in the final version.
[1] https://www.imsdb.com/scripts/Lord-of-the-Rings-Return-of-the-King.htmlI agree that logic takes a place in fantasy but so also does imagination...I mean think in fantasy mithril is renowned for being extremely hard and durable. and may even have "magical" properties. But logically yes piercing weapons (including the fangs/stinger) would be effective against chainmail, normally. but in the movie you get several good looks at just how fine the rings in Frodo's mail is. we also see a troll attempt to kill Frodo with a hefty thrust with a spear of sorts. the pressure alone would be enough to kill a Halfling without actually piercing his body. we can assume that Frodo was not wearing his mail properly when the spider stings him. you can get a good idea of the trajectory of the stinger going straight to his gut .... I think its safe to assume that the spiders stinger has a point just fine enough to pierce Frodo's mail and puncture his skin..... abet barely....