Serena Williams defeated Anett Kontaveit to advance to the third round of the U.S. Open, which she has said will be the final competitive tournament of her career.