As long as the UV protection has not been damaged, your sunglasses can still protect you from UV rays. If you are not sure whether they have UV protection, you can take your sunglasses to any optical store and let them checked.
It depends. Some sunglasses are only made with UV protection coating on the surface of lens and it can lost its function little by little. But in some sunglasses the UV protection is provided within the acrylic substrate and is permanent.