What is a good replacement for a cable end cap? I was adjusting the tension of my front derailleur cable and managed to pop off the cable end cap. The cable is now quite frayed at the end and I think it would be difficult to attach another cap.

What would work as a suitable replacement for a cap? I've read that perhaps superglue or duct tape could work?
Those end-caps are quite reusable. If you take a pair of pliers and squeeze it gently so that the flattened portion opens up you can then slide it back onto the cable. Using the pliers you can then re-crimp it on the cable. Although it looks ugly and everyone will know that you are too cheap to buy a 10c end-cap.

A little bit of superglue placed at the end of the cut seems to help keep the individual wires from separating.