Your employer isn't allowed to punish you for exercising a legal right -- even if you're causing your employer some distress.
However, employers don't always respect their employees' rights -- and some will go out of their way to get revenge on an employee. When that kind of retaliation happens, you can find yourself suddenly fired for an unfair (and illegal) reason.
Because retaliatory discharges are against the law, it's possible to bring a lawsuit against your employer. In order to be successful, however, you need to understand what you have to prove:
You participated in a protected activity
This is usually the easiest part of a case to prove. The Equal Employment Opportunity Commission (EEOC) provides detailed information about what equals protected activities, but they include things like filing a complaint about unsafe working conditions, complaining about sexual harassment or another type of harassment and reporting illegal activity. You also have a protected right to refuse to obey an illegal order from your employer, request accommodations for your religion or disability and discuss working conditions, benefits and salaries with other employees as part of a constructive discussion designed to foster improvement.
You were punished by your employer
If you've been fired or demoted, that's clearly a punishment. Less clear are actions like transfers or changes in job duties. You may have to struggle to show the court that the changes were objectively a punishment and not something that served a legitimate business purpose.
The punishment was due to your protected actions
This is usually the hardest part of a case -- but that difficulty depends a lot on how clever or brazen your employer was when he or she fired you. Some employers think that they're immune from the law and act with impunity. They'll let you and everyone else know exactly why you were fired. Other employers will try to hide their retaliation.
It's important to understand that being fired isn't automatically an act of retaliation under the law. If your employer can show that you were fired for a reason other than your protected action, your lawsuit will fail.
That's why it is so important to keep good records if you are about to do something that you know will displease your employer. You may need those records to prove your case if your employer retaliates.
Source: FindLaw, "Retaliation and Wrongful Termination," accessed March 23, 2018