まい details
Examples
surely won't; I doubt it will — a negative conjecture the speaker states as settled
今さら謝っても、彼女の気は変わるまい。
imasara ayamatte mo, kanojo no ki wa kawarumai.
Apologising at this point will surely not change her mind. neutral
これは単なる偶然ではあるまい。
kore wa tannaru guuzen de wa arumai.
This can hardly be mere coincidence. neutral
その件につきましては、ご心配には及びますまい。
sono ken ni tsukimashite wa, go shinpai ni wa oyobimasumai.
As for that matter, there will surely be no cause for concern. formal
I shall never; I won't ever again — a resolve the speaker makes to himself
あんな思いは二度とするまい、と心に決めた。
anna omoi wa nido to surumai, to kokoro ni kimeta.
I resolved that I would never put myself through that again. neutral
この話は誰にも打ち明けまいと決めていた。
kono hanashi wa dare ni mo uchiakemai to kimete ita.
I had made up my mind never to tell anyone about this. neutral
Formation
G1 終止形+まい(行く→行くまい)/G2 未然形または終止形(食べる→食べまい・食べるまい)/する→すまい・しまい・するまい/来る→こまい・くるまい/ます+まい(行きますまい)attaches to verb stem (special attachment)
Notes
only. In modern prose the form survives mostly in ではあるまい/ではあるまいか,
in 〜まいと思う, and after ます in keigo.
Related patterns
Similar
だろう negates with the verb and leaves the conjecture bare (降らないだろう), which is what a speaker actually says; まい fuses conjecture and negation into one classical morpheme (降るまい) that survives in editorials, prose and set phrases but essentially never in conversation.
そうもない grounds the verdict in how things currently look (雨が降りそうもない, said at the sky), while まい grounds it in the speaker's conviction alone; and まい carries a first-person "I shan't" resolve そうもない has no version of.
(よ)うと思う is how a plan gets announced out loud, and its spoken negative is 行くのはやめようと思う, never 行くまいと思う — the まい version is a resolve a narrator records to himself on the page.
っこない passes the same "no chance of it" verdict at the most casual end of speech, always off the ます-stem (来っこない); まい passes it at the written end, off the 終止形 for godan and off the 未然形 (or the 終止形) elsewhere, and neither survives being moved into the other's register.
まい on its own asserts a conclusion (行くまい); this frame sets まい against the volitional so that neither side is asserted, which is why it takes 迷う and 悩む as its head where bare まい never does.
Lookalikes
しまい is two unrelated words — する's negative-volitional (二度としまい) and てしまう's ます-stem (言ってしまい、後悔した) — and what tells them apart is what PRECEDES them, never position; the てしまう one always has a て-form in front of it, the まい one never does.