"Foolishness is bound up in the heart of a child;
but the rod of correction will drive it far from him."
The child would go in the way of foolishness.
Training in the way he should go involves a rod of correction, that is, discipline.
"The rod and reproof give wisdom;
but a child left to himself brings his mother to shame."
Training in the way he should go involves a rod and reproof, that is, discipline and training in righteousness.
The child would go in the way of serving himself.