Oscar de La Hoya has announced his retirement as a boxer, admitting he could no longer fight at the highest level.