Hit my foot on sidewalk a month ago. It still hurts badly. Is it fractured or sprained?

Hard to say. You could have fractured a bone in the foot or you may have bruised a bone or soft tissue, called a contusion. It should have an x-ray to make the determination.
Have it evaluated. Pain due to trauma may be due to fracture, sprains, arthritis, muscle, nerve or tendon injuries. Have the foot evaluated so that you may get the appropriate care.
X-ray. An x-ray would be important to determine if there is a fracture. Sometimes fractures can extend into joints and can cause pain or disability.