Facebook has a bevy of new security tools. You can learn about them here and here. These are things you'll definitely want to enable.
Google also has improved security for its accounts. If you use Gmail, these new features will help keep your account safe. I would check them out if you use any Google service.
Securing your accounts is only the beginning. Now you have to clean up the mess your ex left. Not deleting the fake posts can affect your online reputation. That can hurt your relationships and even your future employment prospects.
On Facebook, go through and delete all the posts the ex put up. You can do this by going to your Profile page. Hold your mouse over a post. Then click the X that appears in the corner.