Any athlete, whether child, amateur, or professional, chooses a number and tends to wear it for sentimental reasons.
Does anyone know why Jackie Robinson had chosen number 42?
As Benjamin Hoffman explained for the New York Times baseball blog, 42 is just one of Robinson's numbers:
42 represents just his time with the Brooklyn Dodgers.
Playing football while at U.C.L.A., Robinson wore 28, but for the Bruins basketball team he switched to 18. In his time in the Negro Leagues he played for the Kansas City Monarchs and may have had as many as three different numbers, with various accounts having him wearing 5, 8 and 23. And while there seems to be some debate about his number while playing for the Montreal Royals, the Dodgers Class-AAA affiliate in 1946, a video about his time with the team produced by the CBC clearly shows him wearing 10.
As you can see, he wore many numbers over his sports career. As far as I have been able to tell, he had never worn number 42 before he played for the Brooklyn Dodgers, and the number was probably just assigned to him by the team.