While it's interesting to speculate about where AI is going, ChatGPT isn't a competent writer yet. It's pretty terrible, actually. The headlines all talk about how it has "passed" various exams, but if you actually read the stories, it's getting close to the lowest scores. The real story is grade inflation; if you can put together coherent sentences that are basically on the correct topic, you're getting a gentleman's "C."
As for teaching how to write, ChatGPT can't do that at all right now. That requires understanding how people think and learn.
Now, it's pretty cool how good it's gotten in such a short period of time, and it's likely to keep getting better. I think in the short-to-medium term, it's going to be a useful tool for people to write first drafts, on simple topics, under time pressure (e.g., journalism). It will also probably be a widespread cheating tool for poor students. It will probably also lead to much better automated proofreading.
The real threat to teachers is just better teachers. At present, the very best teachers are mostly teaching the same number of students as the very worst teachers, which is stupid. I think that 20 years from now, a lot of education will involve heavy use of recorded content from superstar teachers, with support from teachers who act more like tutors.