Goalkeepers are different. Even if you don't watch football fanatically, you know that this guy under the goalposts usually wears a different shirt and pants in comparison with the rest of the team. Goalkeeper shirt has its own history which is quite long and interesting. In the early history of football, the teams distinguished from each other by the color of their socks, or their armbands. In 1872, in England, some teams starting using stripes and created new uniforms, with different colors, although, still, there were many similarities. Looking back, you will see that many of the teams kept essentially the same uniform they created in the 19th century.
Rules were still strict though, especially for goalkeepers. We could say that goalkeepers suffered the most by FIFA rules, until they somewhat relaxed during the 70s. They were limited to specific colors, including green, blue and white, occasionally red as well. The most popular was green, simply because not many teams used green as the primer color of their uniform. Just before the First World War, goalkeepers were wearing a cap, so as to stand out from their teammates. In 1909 Scots decided to introduce the different color for the goalkeeper.
Goalkeeper shirts used to come in two different kinds: one was quite tight and looked like a vest with long sleeves; the second was the V neck polo sweater, which was more common until the late 60s. It was quite heavy gear for a sensitive position such as the goalkeeper's, so manufacturers worked a lot on ameliorating it. It was in early 70s that goalkeeper shirt started resembling to a true athletic shirt, close to what we know now. The athletic jerseys became very popular in Europe, but both Britain and the USA were kind of slow on the uptake, so these shirts were still not well established in World Football.
Despite the fact that the goalkeeper's number has traditionally been number 1, goalkeepers were sort of late in wearing a number, mostly because they didn't need to, since they already wore different shirt. The rest of players had to be identified somehow, especially since football was becoming increasingly popular and the stadiums were full of fans. Although there is no rule that indicates that number 1 belongs to the goalkeeper, tradition does dictate that the goalpost guard should carry this number on his back. For the records, the first no goalkeeper player who wore the number 1 was Ossie Ardiles, an Argentinean player. Many players followed his example, especially in national teams, although still goalkeepers take the shirt with number 1.
There are some funny stories related to goalkeepers and their shirts. For instance the Croatian player Dražen Ladic wore a shirt with the number 59, because that was his 59th and last game with his country colors in the match against France in 2000. In 1952 Bill Lloyd in Britain was ordered by the referee to change his shirt, because it didn't look like a goalkeeper's shirt, but resembled more to a knitted shirt.