Question: My supervisor is making me do something that the top boss has said not to do. He disagrees with the boss, and is secretly doing it anyway, by making me do it for him. How can I cover myself if he / I get caught?
You haven't given enough information to answer your question. Is what you are being asked to do illegal?
A good general rule of thumb for employees is don't do anything that is illegal, immoral or unethical. Your actions, whether you do it or don't do it, could have consequences for your employment. You could discuss the situation with an adult that you respect and trust.
For more information about employment and discrimination, see question #194.