Examples: I could swim like a fish when I was five. (ability) She could have gone to visit her grandfather. Let's ring him to see if she's there. You could have taken the lift. Now it is working again. (Why didn't you take it?) You should not have entered that area alone. It is very dangerous. You could have been robbed.

I forgot to include a couple of examples about could not and could not have: Margaret could not have had a car accident last night. She was ill in bed. (That is, it is impossible that Margaret had a car accident last night, as she was at home.) I could not read when I was two. I was too young. (ability, the same as "I was not able to read when I was two") I could not arrive home late when I was a teenager. My parents wanted me to be at home at dusk. (permission, the same as "I was not allowed to arrive home late")