How old does a child have to be to go to competitions?

I don't think there is a bottom age limit on competing. If your kid has mastered the skills required to compete in a "pre-preliminary A" level of skating then they can enter the competition (subject to any other terms and conditions applied by the host). The youngest child I've seen at competition is 6 but I'm sure they show up younger than that.

Figure skating is unusual in that kids don't compete in age-stratified groups. They compete against kids who have similar skating abilities but may be of significantly different age. This can make things a little tricky because the reality is that older kids are typically a little more graceful and a little stronger so they tend to be better skaters even if the actual amount of time spent they've been skating is the same. So, your 6 year old who has been skating for 2 years probably won't do as well as an 8 year old who has been skating for 2 years. But I've seen a 6 year old beat out 8 year olds in competition so anything can happen.