Who were the Samurai? Could anyone study and train to become one? The book mentions the Samurai is a warrior class, but couldn't a peasant join?

My understanding is that it was difficult for a peasant to join the Samurai or warrior class. A sense of elitism accompanied membership in the class, and peasants were not ordinarily welcomed into the class.