Hi!
I am very glad that your problem was thankfully mild enough that it didn't suffer from you withdrawing the antibiotic and painkiller.
Please only ever do that after consultation with your vet!
What you need to know is that antibiotics build up with every dosage you give over the whole course and their effect lasts much longer afterwards. Any time you stop, whether that is temporarily or early, you abort this build-up for full efficiency and you also help surviving bacteria developing resistance. You always need to see a full course of antibiotics through, unless your vet or human doctor prescribes another antibiotic or considers it appropriate for you to stop.
Analgesics (painkiller cum anti-inflammatory) do not cause tummy upsets; you should never withdraw them at any point.
Speak to your vet if your piggy loses their appetite or experiences soft poos from an antibiotic. Step in with syringe feeding support and support the gut with 'poo soup' (i.e. transfer of live guinea pig gut biome from a healthy companion) or probiotics instead.
Probiotics, Recovery Foods And Vitamin C: Overview With Product Links
In a more severe case the symptoms you have been reporting could have been very serious indeed, and your suspension of medication could have meant the end for your piggy.