Questions & Answers about Se solo non mi fossi illuso invano!
Why do we use the trapassato congiuntivo (past perfect subjunctive) here instead of the imperfect subjunctive?
Se solo (if only) triggers the subjunctive to express a wish. Because this sentence expresses a regret about something that already happened in the past, we need the past perfect subjunctive (fossi illuso). If it were a wish about the present (e.g., "If only I weren't deluding myself right now"), you would use the imperfect subjunctive: Se solo non mi illudessi!
Why is the auxiliary fossi (from essere) used instead of avessi (from avere)?
The base verb here is the reflexive illudersi (to delude oneself). In Italian, all reflexive and pronominal verbs require essere as their auxiliary in compound tenses. Therefore, we use the imperfect subjunctive of essere (fossi) to build this tense.
Would this sentence change if the speaker were female?
Could I just say "Se non mi fossi illuso invano!" without the word "solo"?
Yes, starting an exclamatory sentence with just Se + subjunctive can also express a strong wish or regret. However, adding solo explicitly translates to "If only" and makes it instantly clear that this is a stand-alone expression of regret, rather than the first half of a hypothetical "If X, then Y" statement.