Robbie Keane has retired from international football after scoring his 68th goal in his 146th and final appearance for the Republic of Ireland.