The ferrule that fits over the cable sheath (outer housing) is broken. Being index shifting housing the cable reinforcement runs longitudinally (these are the strands you see in the photo) to prevent compression so the indexed shifting stays crisp. Brake housing is circular wound and compresses a bit when used. Cheaping out you could likely get by with a new ferrule but if it was me I'd do a complete recable job (brake & shifters, inners and outers) on the whole bike and be done with it. You can buy outer from the LBS by the foot and likely have them cut the lengths you need.