Many flash memory cards are designed to go into read-only mode if they fail. That way you can at least recover any data which is written to them. Depending on the failure, writing to the card could overwrite existing data. And continued writing could cause the card to fail entirely (can't even read from it). So they're designed to go into a read-only safe mode to give you a chance to recover your data. Unfortunately there's no hope for the card if this happens. It is dead and needs to be replaced.
First, try to figure out if this is what's happened to your card. Try the card on a computer and see if you can write to it there.
Try "low level" formatting the card on a computer. That's an archaic and inaccurate term in the context of flash memory. But it refers to wiping and formatting the card at a deeper level than you can normally do with Windows. A lot of times this can clear up errors that cannot be cleared up by formatting the card with Windows' default format tool.
You can also check to see if some obstruction is causing the lock slider on the SD card to move when you're inserting the card into the camera.
Rarely, the lock slider completely detaches from the mechanism inside, resulting in the internal mechanism staying in the locked position while the slider is in the unlocked position. Moving the slider to the locked position and prying/squeezing can sometimes get the two back together in sync.