Melissa Wu has announced her retirement after competing at a record five Olympics and becoming the youngest Australian diver to medal.