Succah, Chapter 4, Mishnah 2. The previous mishnah, the first in the chapter, listed the mitzvah of lulav among those things that are sometimes practiced for six days and sometimes for seven. Our mishnah comes to spell out exactly how.
The text of the Mishnah:
"Lulav shivah keitzad? Yom tov harishon shechal lihyos b'Shabbos - lulav shivah" - when the first day of Succos falls on Shabbos, the lulav is taken all seven days. But if Shabbos falls on one of the other days of the festival, the lulav is taken only six days, since in the time of the Beis HaMikdash the lulav was taken on Shabbos only when the first day fell on it.
The reason for this:
The essential mitzvah of taking the lulav from the Torah everywhere, even outside the Beis HaMikdash, applies only on the first day. It was only after the Beis HaMikdash was destroyed that Rabban Yochanan ben Zakkai instituted taking the lulav all seven days even outside the Beis HaMikdash; but in the days of the Beis HaMikdash, the only day on which the lulav was taken everywhere was the first day.
Because of this importance, only on the first day did the taking of the lulav override Shabbos, while on the remaining days it did not override it.
In summary: In this mishnah we learned how the lulav comes to be taken for seven days - when the first day of the festival falls on Shabbos. The basis for this is that the mitzvah of lulav from the Torah applies everywhere only on the first day (and only after the destruction did Rabban Yochanan ben Zakkai institute taking it all seven), and because of the importance of that day, the taking of the lulav overrode Shabbos on it, unlike the remaining days of the festival.