If an instruction next to a button says ‘do not push’, some people end up pushing it. Their desire to do the opposite overpowers the fear, if any, of repercussions. Is there any word for such a trait in a person?
It is called reactance in psychology. Moreover, the reverse psychology technique relies on the psychological phenomenon of reactance, in which a person chooses the option being advocated against.
When people feel that their freedom to choose an action is threatened, they get an unpleasant feeling called ‘reactance’. This also motivates them to perform the threatened behavior, thus proving that their free will has not been compromised.
Pennebaker and Sanders (1976) put one of two signs on college bathroom walls. One read ‘Do not write on these walls under any circumstances’ whilst the other read ‘Please don’t write on these walls.’ A couple of weeks later, the walls with the ‘Do not write on these walls under any circumstances’ notice had far more graffiti on them.
OED definition and the earliest citation:
Psychology. A response of resistance aroused in a person who feels his or her freedom of choice is threatened or impeded.
1966 J. W. Brehm Theory of Psychol. Reactance i. 2 Since this hypothetical motivational state is in response to the reduction (or threatened reduction) of one's potential for acting, and conceptually may be considered a counterforce, it will be called ‘psychological reactance’.
The quality or character of being wilful; disposition to assert one's own will against reason, persuasion, etc.; determination to take one's own way; self-will, perversity, obstinacy, stubbornness.
From the 14th C, the sense of wilfullness is 'nefariously' deliberate, knowingly, and on purpose.
recalcitrant was the first thing which came in my mind*.
(of a person) unwilling to obey orders or to do what should be done, or (of an animal) refusing to be controlled. Cambridge Dictionary
*As that is what my father often calls me...
The version I'm familiar with is: don't think of pink elephants.
Wikipedia has an article on this called the ironic process theory.
Ironic process theory, ironic rebound, or the white bear problem refers to the psychological process whereby deliberate attempts to suppress certain thoughts make them more likely to surface. An example is how when someone is actively trying not to think of a white bear they may actually be more likely to imagine one.