The Amplified Bible shares something that other translators leave out:
Breaking it down:
1. Train up a child means "dedicate" or "consecrate", in the Hebrew. For dedication and consecration to work, to bear fruit; there must be cooperation from the child, then there will be assimilation. The older the child, the more responsibility they bear for their own training.
2. We wrongly assume that "In the way he should go", means "in the way of righteousness. We are all called to walk in and develop our walk in righteous; but that is not what this verse is saying. What it does mean, is "according to the individual child's temperament", or, "According to the tenor of his way". Again, all are called to righteousness, but each child is unique. Parents are given the call and command to discern their child's unique temperament, disposition, character, talents , and destiny. The way he should go might look different for each child. The meaning of this part of this verse is both wider and deeper than some people have made it.
3. "When he is old, he will not depart from it", means that when they are living as an adult, launched from their parents and childhood, they will have a fruitful life in God; because they have learned how to be who God has uniquely made them to be and given them an abundant life in their unique temperament, talents, and destiny. Godliness will have become second nature and life will be fruitful. There would be no reason to depart from the way (becoming themselves as God has deemed), because that is their identity, which their parents have helped them develop.
The goal is inside out, not outside in. We want to see, and to facilitate the bringing out, and the coming forth, of who God has created this child to be, and nurture that life. The huge mistake our parenting culture has made is to neglect the 'inside out' part. And it is the parents responsibility. If your child has other teachers, they are in your employ, and it is still your responsibility to train your children.
Fathers and mothers: It is your responsibility to facilitate your child's activation into their destiny. Consecrate, activate, and assimilate. Train (consecrate), in the way (activate), and they will not stray from it (assimilate).
We have tons of people today, some went to church when they were young, and some have never been in a church; who are walking zombies, who are living dead lives. They have never been activated. They do not know who God has made them to be.
This is the opposite of what you want for your child. Personally, you must take the active role in discipling your child, so that they are launched into living an adult life in Christ, instead of being "adult children".
Jesus has made your child unique and special, destined to glorify God. Find out what that is and bless it. Jesus calls us all to the inside out life. Religion is outside in. Christianity is people in Christ.