The outer cable housing for the rear derailleur broke right where it inserts into the rear derailleur, and this caused shifting problems. The repair involves cutting new cable housing to the same length of the old housing, replacing the cable ferrules and routing the old cable through the new housing, reconnecting everything and adjusting the rear derailleur if necessary. The inner cable and cable housing should be cut using bicycle cable cutters. The cutters I recommend and use are Park Tools CN-10 cable cutters.
After cutting the cable housing it makes it easier to route the cable through the housing if you use an Awl or Ice pick tool to open up the hole in the cable housing. The hole tends to get crushed slightly from the cable cutters.
When purchasing new cable components its important to use the correct cable housing or shifting might not work correctly. Most, almost all, index shifters use cables with an inner cable diameter of 1.2 mm and use compressionless cable housings. Wound cable housing are used on brake cables and can’t be used with index shifters. Friction shifters can use a wound or compressionless cable housing, but perform better with a compressionless housing.
John 3:16 “For God so loved the world that he gave his one and only Son, that whoever believes in him shall not perish but have eternal life.“