The reality is that there is not much you can do to physically prevent your employer to not fire you. As an at-will employee, not only can they choose to terminate you for any reason or no reason, but they can also choose to violate the law by terminating you for discriminatory or retaliatory reasons, and deal with any legal consequences later. While a court/jury may award money damages to compensate you for your lost wages, emotional distress, etc., no one can force your employer to take you back once they fire you.
However, even though you can't prevent your termination, there are three things you can do to enhance your potential age discrimination and wrongful termination claim:
1. Seek specific feedback about your alleged performance issues.
Ask nicely but persistently what's wrong with your performance and how you can improve it. The employer's vague responses to these kinds of request or no request at all will be one kind of evidence you will be able to use to show that the alleged performance issues were just an excuse for firing you because of age.
2. Be nice to your management at all times.
Do not create any evidence of insubordination in person or in writing, as this will make any wrongful termination claim much harder to prove. This is because if your employer has a legitimate reason to terminate you, such as insubordination, misconduct, policy violations, etc., proving that the real reason for your terminating was something else will be much harder. All your interactions and e-mails have to be polite, civil and free of any threats or signs of entitlement on your part.
3. Consider complaining about discrimination to your employer or EEOC/DFEH.
If you complain about age discrimination to your higher management or HR in writing and/or to EEOC/DFEH, and your employer fires you shortly after, you might be able to bring a retaliation claim in addition to discrimination claim to make your case stronger. Often, retaliation is easier to prove than discrimination. Therefore, having that extra retaliation claim can prove to be critical, especially if the discrimination claim turns out to be weaker than you thought or if it is dismissed altogether on summary judgment. Make sure you check out the discrimination/harassment complaint sample form that will be helpful to you in drafting your complaint to HR/management or EEOC/DFEH.