(よ)うか〜まいか details
Examples
whether to do it or not — the speaker weighing an action against not taking it
参加しようかしまいか、締め切りの日まで迷っていた。
sanka shiyou ka shimai ka, shimekiri no hi made mayotte ita.
I went back and forth on whether to take part, right up to the deadline. neutral
声をかけようかかけまいか迷ったが、結局黙って通り過ぎた。
koe o kakeyou ka kakemai ka mayotta ga, kekkyoku damatte toorisugita.
I hesitated over whether to say something to him, and in the end walked past without a word. neutral
今期の計画を見直そうか見直すまいかで、役員会でも意見が分かれております。
konki no keikaku o minaosou ka minaosumai ka de, yakuinkai de mo iken ga wakarete orimasu.
Even the board is divided over whether to revise this term's plan. formal
Formation
V(よ)うか〜Vまいかattaches to noun phrase (schematic)
Notes
悩む, 決めかねる — or of division, 意見が分かれる. The
まい half takes whichever class shape its own verb has.
Related patterns
Similar
かどうか embeds any yes/no question under a verb of knowing or asking (来るかどうか分からない); (よ)うか〜まいか reports only the speaker's own wavering about acting, so its subject is the would-be actor and its head a verb of hesitation.
まい 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
Both repeat one verb inside a か〜か frame, but か〜ないかのうちに is a TIME clause pairing plain affirmative and negative to blur two events (鳴るか鳴らないかのうちに); this one pairs volitional with まい and marks no time at all.