Yes… but an article would be better: Advising children to behave well is the parents' duty. / Advising children to behave well is a parent's duty. (Note the apostrophes.)
sorry dear I have one more question when I write these sentences in the Microsoft word It underlines the auxiliary verb "is" with a green line, and asks me to change it to "are".Why? Advising children to behave well is a parent's duty. Advising children to behave well is the parents' duty. as follows Advising children to behave well are a