We've all been through this, except a lot of the newer cavy slaves. Eventually, you will lose one of your pigs and have one remaining.
Sometimes, they do ok when they're alone. It has been my experience however, that when a pig suddenly loses it's partner they become sad, lazy and bored. I got the biggest glimpses into the benefits of having buddies just in the past 8 or 9 months.
Long story short, I lost a beloved pig in October last year. Both pigs were ill, and one made it while the other did not. The remaining pig was left by himself for two months, because he wasn't well yet himself and we couldn't risk getting another pig sick. When he WAS finally well, he was introduced to a new brother. The difference was night and day. Here's their introduction thread if you want a quick look.
https://www.guineapigcages.com/forum/threads/122268-It-s-Introduction-Day!
Long story short, Scooter was thrilled to have a new buddy and Leo, who had never known another pig, was beside himself with happiness. Sadly, it was short lived. Scooter passed away suddenly in May of this year, and Leo was so very, very sad. I could see his state of mind decline rapidly and moved quickly to find him a new buddy. Too quickly for me, but Leo was the important one.
Losing Scooter has changed Leo. He now sticks to his new brother like glue. He is such an affectionate and doting big brother it's unbelievable. Simon had a vet appointment yesterday, and I thought Leo was going to disappear inside himself he was so distraught.
So, to answer your question, I believe pigs should never be kept alone if circumstances permit more. As @
bpatters has stated, some countries consider it an act of cruelty to keep only one unless there are extenuating circumstances. If your pig has a buddy and they get along great, leave it that way.