The order of operations is
Parentheses
Exponents and Roots
Multiplication and Division left to right
Addition and Subtraction left to right
6÷2(1+2)
Parentheses
6÷2*3
Multiplication and Division left to right
3*3
9

This is correct. However, a bit of explanation might be in order...
The reason this is correct is because multiplication is the
inverse operation of division, and vice versa. And subtraction is the
inverse operation of addition, and vice versa. In other words, multiplying x by y is the same as dividing x by the inverse of y (or 1/y). Similarly, subtracting y from x is the same as adding the inverse of y (or -y) to x. If you are paying particular attention to this, you might have noticed that I called the inverse of y "1/y" in one case, and called the inverse of y "-y" in the other case. What is important to remember is that we are talking about the inverse of y
under the operation. So under multiplication, it is 1/y, and under addition it is -y; you always use the inverse determined by the operation you are doing.
Now here is the key - since division is simply the inverse of multiplication, there is no mathematical justification for choosing to perform one before the other. That is, there is no mathematical justification for multiplying before you divide (or vice versa). Similarly for addition and subtraction.
Therefore, there must be a convention, that is universal, that we must follow when we formulate a math problem. And the convention is, when we are given a choice to either multiply or divide (as we come across in this problem),
we go from left to right.
This is the only thing that makes mathematical sense, because there is no mathematical justification for always multiplying before we divide (because they are, in essence, mathematically the
same operation (one is simply the inverse of the other)).
So, if you rework this problem, keeping in mind that since there's no mathematical justification for multiplying before we divide, and when we are faced with this choice work from left to right, you will get 9 as the answer.
Now, why the following is not correct:
6 ÷ 2(1+2) = x
6 ÷ 2(3) = x
6 ÷ 6 = 1
This is not correct, because in 6 ÷ 2(3) = x,
there is no mathematical justification for choosing to multiply 2(3) before you divide 6 by 2. When confronted with this, you
have to fall back on the convention of going from left to right (and the person who formulated the problem, if he wants you to get the same answer as him, must keep the left to right convention in mind (that's why it's important that we have a universal convention of order of operations - the one that grepper stated that I quoted at the top of this post).
or
6 ÷ 2(1+2) = x
6 ÷ (2+4) = x
6 ÷ 6 = 1
This is not correct, because again, in 6 ÷ 2(1+2) = x,
there is no mathematical justification for choosing to multiply 2 throughout the parentheses before you divide 6 by 2. In this case, we must again fall back on the convention of going from left to right. (Actually, this is also wrong because according to convention, you do what's inside parentheses first.)
or
6
____ = X
2(1+2)
6
______ = X
2(3)
6
___ = 1
6
Again, this is not correct because what you are implying by the way you wrote it is that multiplication of 2 by what's in the parentheses somehow has precedence over dividing 6 by 2, and there is no
mathematical justification for this. This, by the way, is simply another way of writing the problem the same as the first way you wrote it.
Again, since multiplication and division are simply inverses of each other, there is no mathematical justification for choosing one over the other, and we must fall back on the convention of going from left to right when faced with this choice.Of course, for this to work, there must be a universal convention dictating the order of operations, and the person formulating the problem must formulate it according to this convention (if he doesn't want ambiguity).
As a side note, the PEMDAS is really PE(MD)(AS), meaning that M and D carry equal weight, and so you do whichever comes first from left to right (according to the established convention), and similarly A and S carry equal weight. I think a lot of confusion comes from people thinking that M comes before D, but there is no mathematical justification for this to be so.
As another aside, no one will argue that 2(3) = (3)2. That is, in mathematical terms, we say that the integers are commutative under the operation of multiplication. However, 6÷2(3) ≠ 6÷(3)2. If there were some mathematical justification for choosing to multiply before we divide, then they would be equal, but since division is simply multiplication by the inverse, there is no mathematical justification for choosing to multiply before we divide. Therefore, when faced with this situation, you go from left to right.
If you remember nothing else from this post, remember that multiplication and division carry the same weight, and therefore there's no mathematical justification for always choosing to do one before the other. That is why the convention is to go from left to right when faced with this decision.
Hope this helps.