Former world number one Caroline Wozniacki announces she will retire after the Australian Open in January.