There are two theories as to who wrote the Bible. The first, and by far the most simple, states that the Torah was written by G-d and given to Moses, who wrote it down. There are problems with this idea, though. Firstly, the book of Deuteronomy records Moses' death, and briefly what happens afterwards, which would have been difficult for Moses to write! There are two possible explanations to recover from this, though. The first is that the Torah was completely narrated to Moses, who wrote of his own death as he was commanded, and then died. Another answer is that the book was finished off by Joshua. There is also the problem of the phrase in Deuteronomy XXXIV, 10 - "And there hath not risen a prophet since in Israel like unto Moses....", which sounds as though it were written far after Moses' death, but again could have been written by him with the future being dictated to him by G-d.
The other theory involves the idea of split authorship over various centuries. Four authours, named P, J, D and E (I think!) are attributed with different sections according to different writing styles. For example, the two accounts of creation in Bereshis were written by two different authors, so the theory goes. This accounts for their different perspectives.
This theory also explains easily the account of Moses' death. P, a priest (possibly Ezra the Scribe), is attributed with having written down the laws in the Torah, which is a different style to the stories of the Patriarchs or of the Exodus from Egypt.
There are large problems with this theory, though, as those who follow it will testify. Many of the references to the Exodus in Egypt refer to it as though it were a recent memorable event, and could not have been written years later in the same style. The P books exalt the High Priest, but in Ezra's days, the High Priests were not worthy of such praise. It has also been said that the writing styles are indicative of writing around the time of the events, and not from years after.
All in all, this is a highly controversial topic - the Masorti movement of Jewry having been started because one rabbi decided to question the Divine Authorship, and was thus banned from Orthodox Jewry. In truth, though, it is a matter of faith, and there is 'proof' for both sides of the argument.