As your great grandmother was married at the time, the child would generally not be classed as illegitimate, and would take the family name. It was assumed that the husband was the child's father even if he was not.
In your case perhaps your great grandmother admitted that your grandmother was illegitimate, and that her husband was not the father.
Do you have your grandmother's birth certificate?