How can you tell if your foot is broken or sprained?

Broken. Only x rays will show that. See your podiatrist.
X-ray. You will need and x-ray to see if you have a fracture or if it is just a sprain. If fractured, you will need to be immobilized with a splint, cast, or rigid walking boot depending on the location of the injury. If fractured, it may need to be reduced in the office or possibly in the operating room. Have it evaluated by your physician to get the appropriate treatment.