On top of Jutschge's answer,
something you need to keep in mind is that you are not the only one in this situation. Your middle opponent should be in the same spot.
Also, having a massive amount of AP doesn't do everything. Of course it's better but if you can't survive 2 seconds, you won't be able to use them.
For that you have different choices:
The most important part is the positioning, we will never say it too many times. And this is true for every single game. You might be squishy, but if you are positioned well, they won't be able to access to you without taking massive damage first.
Positioning is almost everything. If you position well in a team fight you will be able to deal massively more damage than if you were in a tight spot.
You should almost never get out of position to kill a carry, if you fail to kill him, and you get killed, you have probably made your team lost.
In theory, with a good positioning, you can go full AP and not worry (in theory). In practice, you will have a jarvan jumping on you and dealing massive damage while being tanky. This is why the items are for.
This is really dependant of you champion, THEIR CHAMPIONS too, your play style and in general of how the game goes but those might be useful.
Get zhonya, its a must have for pretty much any late game and don't forget to use it!
If you can, Seraph's Embrace is really a good addition to zhonya late game and a big boost in AP too.
And other resistance items like guardian angel.
Getting damage over time as a % of their health? Liandry's Torment of course.
Getting penetration. If they have a lot of MR, you will even need it more.
Protect your AD carry
Your role in end game is (as the rest of the team) to protect the AD carry.
(it actually depends on your champion, if you have an assassin for instance, it's pointless trying to protect someone, try to get their carries)
Why? yes you are a carry too, a damage dealer, but let's be clear, your time to shine is over, it's now his. So make everything you can to make him live