Basketball was invented by a guy named Dr. James Naismith. The first basketball game was played with a peach basket and to get the ball out you had to climb a later and get the ball out of the basket. The first ball was a stray soccer ball. The first real game was played on June. 20, 1892. Someone thought about cutting a hole in the bottom of the basket. That is how basketball got it's name because they used a basket and you shot with a ball.
Dr. Naismith invented the game because he wanted to fill a game between football and soccer and rugby and wrestling. He also wanted it to be played inside. He wanted it to fill the gap between football in the fall and baseball in the summer. He wanted the game to be less rough then the other sports!
An interesting problem they had was people sat in balconies and helped their favorite team win. They used their feet and hands and any other things they had! That's when they invented backboards so people don't score and the players score instead. Some of the famous shooters were people from the balconies!