Lying to get out of something or to get attention is wrong. However, if you hurt your ankle, you may find it convenient to take advantage of the situation and make it appear worse than it is. Hopefully, you have a good reason for faking a sprained ankle, and it's not just to get out of physical-education class.
Make up a story about how you sprained your ankle. Say you fell down some stairs or sprained it playing a sport. If need be, take a "fall" in front of witnesses to make the injury seem authentic.
Limp on your "sprained" ankle. Practice this movement when you're alone by placing the weight of one foot onto your toes as you walk, and then step quickly and plant your other foot normally.
Place a bandage around the ankle, or keep your shoe off that foot and wear only a sock. This will make the injury seem real and will also help you remember which ankle is supposed to be sprained.
Get a pair of crutches, if possible. Keep your "injured" leg bent, and do not put any weight on that ankle at all. Just the sight of crutches will likely convince everyone that you do have an ankle sprain.
Show some pain, especially during the first couple of days. Wince or grimace sometimes to show how uncomfortable your fake ankle sprain is.