Much of the online stalking may be due to simple knowledge of user account details. The ex may well have been covertly collecting the victim's login details for some time before the actual breakup.
Your friend should change their passwords on all their online accounts, especially social networking.
Besides fixing the PC's OS, it is also worth checking through all the user accounts, deleting/deactivationg any surprises and changing passwords on all the rest, but I would hope that has already been done.
Does your friend have a smartphone or other mobile device? These things can often also be tracked, for example if GPS (or other) geolocation is active and not made private, or of course if a covert tracking app is installed - and there are a good few of those about.
I'd just add, the "I'm sure my ex wouldn't have / couldn't have done that" is a sure sign that the ex has been misdirecting the victim, but is all too often taken the other way because that's what the victim wants to believe. In my experience, conquering that wanting to believe is more than half the battle.
And finally, the victim needs to methodically collect any and all evidence of stalking and/or harrassment, both online and offline. Keep that dossier in a safe place such as a USB stick and back it up, say create a new Cloud storage account for the purpose. If the ex ever gets out of order, that dossier can and must be handed to the police and legal action started to keep the ex at bay. It all sounds a bit draconian, but believe me, ex-es can sometimes turn very, very nasty and if your victim doesn't protect themself now they risk a truly evil few years ahead.
"Klinger, do you know how many zoots were killed to make that one suit?" — BJ Hunnicutt