The word algebra is a Latin variant of the Arabic word al-jabr. This came from the title of a book, "Hidab al-jabr wal-muqubala", written in Baghdad about 825 A.D. by the Arab mathematician Mohammed ibn-Musa al-Khowarizmi.
The words jabr (JAH-ber) and muqubalah (moo-KAH-ba-lah) were used by al-Khowarizmi to designate two basic operations in solving equations. Jabr was to transpose subtracted terms to the other side of the equation. Muqubalah was to cancel like terms on opposite sides of the equation. In fact, the title has been translated to mean "science of restoration (or reunion) and opposition" or "science of transposition and cancellation" and "The Book of Completion and Cancellation" or "The Book of Restoration and Balancing."
Jabr is used in the step where x - 2 = 12 becomes x = 14. The left-side of the first equation, where x is lessened by 2, is "restored" or "completed" back to x in the second equation.
Muqabalah takes us from x + y = y + 7 to x = 7 by "cancelling" or "balancing" the two sides of the equation.
Eventually the muqabalah was left behind, and this type of math became known as algebra in many languages.
However, algebra was not invented by any single person or civilization. It is a reasoning skill that is most likely as old as human beings. The concept of algebra began as a reasoning skill to determine unknown quantities.
For example, an early human being (living nearly 7 million years ago) probably ran across the problem of food being stolen from him by other animals... He may have had 5 berries laying on the ground, but then, suddenly a bird flew by and now only had 2. He probably wondered how many berries the bird ate (an unknown quantity). He could probably reason that 3 berries were missing and thus 3 berries were eaten by the bird.
If you perceive algebra in this way, then no one invented algebra because it is a natural instinct encoded in our genetics... it is our ability to reason out quantities that produce algebra. However, the elaboration of this reasoning into structured symbolization and manipulation is not credited to any single individual. Many people, throughout the world and throughout the ages, have developed parts of what is now known as ALGEBRA. The word itself -algebra- comes from a book called Kitab al-Jabr wa-l Muqabala (translated: Calculation by Way of Restoration and Confrontation or Calculation by Completion and Balance), written by Persian mathematician Muhammad ibn Mosa al-Khwarizmi (approximately) in the year 820 AD. However, this was not the first written record of algebraic concepts or manipulation. Ancient Egyptians, Babylonians, Indians, Chinese, and Greeks all have written records of algebra dating far before this date. No one can specify any one time, place, or person solely responsible for the elaboration of algebra as a mathematical discipline.
However, it is true that the Acient Greeks invented "algebraic method" in which you solve a problem by calling a unknown in the question x, then list out all the other expressions containing x. Then you find two equal expressions and form a equation and solve it.