What is the basis for the idea of a seven year peace treaty with Israel in the end times? I have heard the concept that in the end times there will be a 7 year peace treaty signed with the nation of Israel, and that three and a half years into that treaty, it will be broken.

What is the biblical basis for this idea?
There are two seemingly conflicting descriptions of the end times for Israel, that many resolve by figuring there will be a peace treaty.  Since the tribulation is 7 years, they assume that to be the duration.

To wit, the references in question are:


Per Matthew 24:6, it will be a time of war


  You will hear of wars and rumors of wars, but see to it that you are not alarmed. Such things must happen, but the end is still to come. 

Per Ezekiel 38, it will be a time of "peace" (although, see #3)


  7 “Be ready and keep ready, you and all your hosts that are assembled about you, and be a guard for them. 8 After many days you will be mustered. In the latter years you will go against the land that is restored from war, the land whose people were gathered from many peoples upon the mountains of Israel, which had been a continual waste. Its people were brought out from the peoples and now dwell securely, all of them. 

The simplest resolution comes from continuing to read Ezekiel 38:


  9 You will advance, coming on like a storm. You will be like a cloud covering the land, you and all your hordes, and many peoples with you.
  
  10 “Thus says the Lord God: On that day, thoughts will come into your mind, and you will devise an evil scheme 11 and say, ‘I will go up against the land of unwalled villages. I will fall upon the quiet people who dwell securely, all of them dwelling without walls, and having no bars or gates,’ 12 to seize spoil and carry off plunder, to turn your hand against the waste places that are now inhabited, and the people who were gathered from the nations, who have acquired livestock and goods, who dwell at the center of the earth


The idea is actually fairly simple - it is a treacherous time.  There is all sorts of war, and israel is duped into a bad alliance.  (Note: This is a recurring theme throughout the Prophets and Kings)  The peace treaty with an unscrupulous nation (the Anti-Christ) gives the appearance of peace, but is actually a setup for a very bad outcome. 
This also reads well with Daniel 9


  And he shall make a strong covenant with many for one week, and for half of the week he shall put an end to sacrifice and offering. And on the wing of abominations shall come one who makes desolate, until the decreed end is poured out on the desolator.”


Traditionally, premillenial dispensationalists view the "70th week" of Daniel as the end times.  The first sixty-nine weeks are viewed as the time between Daniel and the Messiah, then the Church age puts the 'pause' button on the 70th week.  The tribulation is basically that last week. 


This is the traditional pre-trib / dispensationalist reading, such as those popularized by Tim LaHaye in the Left Behind series. I am quite familiar with the reading, but remain unconvinced either way by it.  As such, this answer is not based on the merits of the claim, only that the combination of the two is typically the basis for the claim.