Republic of Ireland icon Robbie Keane has announced his retirement from football.