How is magnitude defined in Euclid's elements? I thought to avoid working with irrational numbers ancient Greeks introduced the concept of magnitudes. This allows mathematicians to do a rigorous mathematics based on geometry for 2000 years. However, what I do not understand is that how could they rigorously define things like addition and multiplication for magnitudes without relying on numbers. By rigorously I mean to only use the concept of magnitudes and nothing else.
For example for magnitude x, why was it acceptable to define x+x=2x? shouldn't 2 in this case be defined in terms of magnitudes? 
 A: Magnitude is not really a defined term in the first few books of Euclid, despite the fact that the concept is used informally beginning with the very first proposition of Book I; it is used to capture the informal notion of (variously) length, area, or volume.  If $AB$ is a line segment, for example, then an expression like "twice $AB$" simply means "a line segment formed by adjoining two segments, each separately congruent to $AB$".  If $ABCD$ is a rectangle then "twice $ABCD$" means "a rectangle formed by adjoining two rectangles, each separately congruent to $ABCD$".  When Euclid says something like "rectangle $ABCD$ is equal to twice triangle $PQR$" he means that two identical copies of triangle $PQR$ have area equal to rectangle $ABCD$.  Proving such claims does not require that magnitudes be interpreted as numerical quantities; it does, however, require some axioms about magnitudes (things like a whole being equal to the sum of its parts, for instance).  
A: I am treating this as a reference request. The first reference you want to consult is Euclid's Elements. If you can get Heath's translation, then it contains some excellent commentary, but there are good versions online too, e.g., a nice translation by R. Fitzpatrick.
Particularly important to dispel your misunderstandings are:
Book V, which expounds Eudoxus's theory of proportion. This begins with what is effectively a relative definition of the concept of magnitude: a magnitude is something like a length or an area that you can add, subtract and compare geometrically. Particularly important is definition V.5, which tells you how to compare two ratios between arbitrary magnitudes. Dedekind's approach to defining the real numbers is a direct descendant of this definition.
Book VII, which is about elementary number theory. It begins with a definition of number, i.e., positive integer. I don't believe that
numbers where intended to be thought of as magnitudes, but the theory
of proportions also applies to numbers and so numbers and magnitudes can be compared. Euclid has no notion of algebraic expression, but he can
say of magnitudes $x$ and $y$ that "$x$ is to $y$ as $1$ is to $2$", meaning $y = 2x$.
Book X, which is about incommensurable magnitudes, i.e., magnitudes $x$ and $y$ such that $x/y$ is irrational. It begins with a definition of Euclid's algorithm for arbitrary magnitudes. Theorem X.2 analyses the termination condition for this algorithm and concludes that it terminates on inputs $x$ and $y$ iff $x/y$ is rational.
You should then bear in mind that Euclid's Elements is not an enyclopaedic compendium of all ancient Greek mathematics. It was probably intended as something more like a graduate textbook. There are lots of good sources on the history of mathematics that you should look into if you are interested in the subject. The MacTutor page on Euclid could be a good place to start in this case.
