This question is very similar to another: Understanding Jesus' apparent lie in John 7:8 The answers there are applicable here.
The feast was Tabernacles or Booths:
Now the Jew's Feast of Booths was at hand. (7:2) 1
This takes place in the seventh month of the year, during which there are 3 Feasts:
Feast of Trumpets: The Lord spoke to Moses: “Tell the Israelites, ‘In the seventh month, on the first day of the month, you must have a complete rest, a memorial announced by loud horn blasts, a holy assembly. You must not do any regular work, but you must present a gift to the Lord.’” (Leviticus 23:23-25)
Day of Atonement: “The tenth day of this seventh month is the Day of Atonement. It is to be a holy assembly for you, and you must humble yourselves and present a gift to the Lord. You must not do any work on this particular day, because it is a day of atonement to make atonement for yourselves before the Lord your God. (Leviticus 23:27-28)
Tabernacles: “Tell the Israelites, ‘On the fifteenth day of this seventh month is the Festival of Temporary Shelters for seven days to the Lord. On the first day is a holy assembly; you must do no regular work. For seven days you must present a gift to the Lord. On the eighth day there is to be a holy assembly for you, and you must present a gift to the Lord. It is a solemn assembly day; you must not do any regular work. (Leviticus 23:34-36)
The first two were single day events and Tabernacles lasted for seven days after which the people were to observe an eighth day of Sabbath rest. From John's description, we know it was this last feast that Jesus attended:
When the feast was half over, Jesus went up to the temple courts and began to teach. (7:14)
On the fourth day, when it was half over, Jesus went into the Temple courts and began to teach.
Jesus attended one of the three feasts of the seventh month:
Feast Jesus Attended
Trumpets No
Day of Atonement No
Tabernacles Yes
The brothers of Jesus went to Jerusalem (before Jesus) to observe the "feast". They were there for the Day of Atonement (and possibly Trumpets). These are the Feasts Jesus did not attend.
The most likely scenario is that Jesus stayed in Galilee, while His brothers went to Jerusalem to observe the Day of Atonement. The Day of Atonement is considered to be the Holiest Day of the year. This is the one day of the year when the high priest may enter the Most Holy Place.
Since Tabernacles begins four days later Jesus would have time to travel to Jerusalem and to be present as the Law requires:
Three times a year all your males must appear before the Lord your God in the place he chooses for the Festival of Unleavened Bread, the Festival of Weeks, and the Festival of Temporary Shelters; and they must not appear before him empty-handed. (Deuteronomy 16:16)
Not only did Jesus not lie, the Gospel writer has described the events to make this point: the One who was without sin did not attend the Day of Atonement.
1. All Scripture from the NET translation