Option 1 -> This refers to revealing one's true nature, which is not what the idiom means.
Option 2 -> This captures the idiom's meaning of publicly and uncompromisingly committing to a position or belief.
Option 3 -> While writing against government policy may have consequences, this isn't the meaning of the idiom.
Option 4 -> The idiom is about commitment to a stance, not about gaining recognition.
Hence, Option 2: firmly committed himself to his opinion -> "Nailed his colours to the mast" is a nautical idiom meaning to make a firm, public commitment to a position without any intention of backing down. By writing a newspaper article attacking government policy, he publicly declared his stance and committed to it unwaveringly -> correct