His father was Louis the German, the first king of East Francia and a grandson of Charlemagne; he was called "the German" when East Francia became known later as the Kingdom of Germany.
When Charles was young, something happened to him that had him raving and foaming at the mouth. Fearing demonic possession, he was taken up to the altar at church to exorcise him. This incident (related by Notker the Stammerer) frightened him and he became very pious ever after, described as:
… a very Christian prince, fearing God, with all his heart keeping His commandments, very devoutly obeying the orders of the Church, generous in alms-giving, practicing unceasingly prayer and song, always intent upon celebrating the praises of God.
He frequently fell ill, and some attribute the demonic incident and his later troubles to epilepsy.
In 859, when he was 20 years old, he was made Count of the Breisgau (southwest Germany). A few years later, his brother Carloman revolted against their father, followed by their other brother, Louis the Younger; Charles decided to join them in revolt. They were successful, and their father divided his lands, giving the Duchy of Swabia to Charles.
After Louis the German's death in 876, the three brothers did something that may be unique in the annals of medieval rulers: they got along. Each ruled his territory and did not try to expand his borders at the expense of his siblings. A year later, Louis the German's brother, Charles the Bald, died, and the title King of Italy went to Carloman by prior agreement. In 879, a stroke incapacitated Carloman, who offered Bavaria to Louis and Italy to Charles.
Charles was then King of Italy, and spent all his time there.
As King of Italy, there were expectations now that he was not able to meet. One was when the pope requested help against an invader. I'll tell you that story next time.