This is a largely metaphysical question, which is best answered by St. Thomas Aquinas in his Summa Theologica (see Part I, Article 10, on eternity).
Not only did God not have a beginning, He will have no end, because God is eternal. We all have difficulty understanding this, because the nature of God is far beyond anything we can relate to: He is beyond space and time. The very nature of God is to exist. God has other attributes as well, many of which can be deduced by reasoning: God is eternal, immutable, omniscient and omnipotent.
Just for fun, try to wrap your mind around this explanation of eternity by the Angelic Doctor. (Warning! Pay very close attention.):
“I answer that, As we attain to the knowledge of simple things by way of compound things, so must we reach to the knowledge of eternity by means of time, which is nothing but the numbering of movement (that is, change by ‘before’ and ‘after.’ For since succession occurs in every movement, and one part comes after another, the fact that we reckon before and after in movement, makes us apprehend time, which is nothing else but the measure of before and after in movement. Now in a thing bereft of movement, which is always the same, there is no before or after. As therefore the idea of time consists in the numbering of before and after in movement; so likewise in the apprehension of the uniformity of what is outside of movement, consists the idea of eternity.
“Further, those things are said to be measured by time which have a beginning and an end in time, because in everything which is moved (that is changeable) there is a beginning, and there is an end. But as whatever is wholly immutable can have no succession, so it has no beginning, and no end.
“Thus eternity is known from two sources: first, because what is eternal is interminable — that is, has no beginning nor end (that is, no term either way); secondly, because eternity has no succession, being simultaneously whole.”