Since M31 can be observed with the naked eye, it was discovered very early. The first written reference is from the first century by a Persian astronomer, Abd al-Rahman al-Sufi. The first telescopic observation was documented by Simon Marius in Germany in 1612. Charles Messier who of course included the galaxy and one of its satellite galaxies (M32) in his catalogue in 1764 mentioned Marius as the discoverer, because he did not know about al-Sufi's works. M110 was discovered independently by Messier in 1773 and by Caroline Herschel (William Herschel's sister) in 1783.
The Andromeda Galaxy
M31 is part of the Local Group of Galaxies, it is the closest spiral galaxy (but not the closest galaxy, because there are some non-spiral galaxies closer), and the largest in the Local Group. It is a barred spiral galaxy, classified as SA(s)b in the De Vaucouleurs system, with the bars being viewed along their axis. Dense dust lanes are also present in front of the galaxy, making it very similar to the Milky Way.
After Heber Curtis had discovered a nova within M31 in 1917 and identified 11 other novas in older photographs of M31, he realised that these novae are much fainter than other novae in the sky by about 10 magnitudes. Based on this observation he determined the distance (with a great error in fact) of the galaxy to be approximately 500000 light years. At that time Milky Way was believed to be the whole universe by astronomers, and spiral nebulae were believed to be part of it. The distance calculated by Curtis was one of the first scientific evidences suggesting that galaxies are outside of Milky Way. Immanuel Kant, the great philosopher invented the term 'island universe' to describe the separation amongst the Milky Way and other spiral nebulae or extra galaxies. In 1920 there was a debate between Heber Curtis and Harlow Shapley in the Baird auditorium of the Smithsonian Museum of Natural History. Curtis was arguing in favour of the new theory, while Shapley represented the opposite point of view. A few years after the debate, Edwin Hubble identified cepheid variable stars within several spiral nebulae using the Hooker Telescope. The observations made in 1922-1923 left no doubt about spiral nebulae are entire galaxies outside of the Milky Way.
The distance of M31 was measured using four different methods recently, all the measurements gave the same result: about 2.5 million light-years from us.
The history of Andromeda Galaxy is history of galactic merger. According to recent publications Andromeda was formed about 10 billion years ago, when several protogalaxies were merged. About two billion years later it collided and merged again with another galaxy. During this merger the galactic halo and extended disc were formed in Andromeda, and also a very intense star formation was triggered in the galaxy. Since then there have been other mergers as well, the most recent was about 100 million years ago. Andromeda's disc is warped like the letter S, which was probably caused by M33 when it was passing by about 2-4 billion years ago. The encounter has also distorted the outer regions of M33. M31 collided with M32 as well, more than 200 million years ago, when M32 was passing through Andromeda's disc. More than half of M32's mass was stripped by M31 during this event.
Very probably M31 and M33 will encounter again about 2.5 billion years in the future, the interaction will be much more intense than the one in the past. According to current theories, M31 will tear M33 apart and absorb it ... another merger in the future. Andromeda Galaxy is one of the blueshifted galaxies, which means its distance from us is decreasing. Although its tangential velocity is not known precisely enough, there is still a good chance for a merger between M31 and Milky Way about 4 billion years from now, in the merger a giant elliptical galaxy would be formed.
Andromeda Galaxy has more than a dozen of satellite galaxies, most of them lie on a single plane pointing to the close M81 galaxy group. The two most prominent satellite galaxies of Andromeda are M32 and M110. Both of them are dwarf elliptical galaxy. M32 (left to Andromeda's centre in the picture) does not show much activity, there are no dust lanes and interstellar gas available in the galaxy which could fuel star formation, however there is a super massive black hole in its centre. M110 (below and to the right of Andromeda's disc in the picture) does not have such back hole.