ariels noded the two envelope paradox. This is a spolier if you haven't read that or thought about it for yourself.

The assertion "proved" in the paradox is of course wrong. It's easy to come up with an alternative line of reasoning, showing you profit nothing by switching envelopes. Malik has done this below, if you can't come up with the "proof" yourself. But where does the reasoning of the two envelope paradox break down?

It's actually more of a trick than a paradox. The "proof" depends on the (implied) assertion that any sum is equally likely to be in the envelope. If you knew the distribution according to which the sum in both enevelopes was chosen and you saw \$x in your envelope, you could calculate the a posteriori probablity of the other envelope holding \$2x or \$0.5x (just by comparing the probabilities of the total sum being \$3x or \$1.5x). Half of the time you'd have to guess you probably got the smaller sum, and half of the time that you got the larger.

Now, it seems at first sight to be a fair solution to say "but I don't know the distribution by which they chose the sum, so we'll just say those probabilities are the same". But it turns out there just isn't any probability distribution like that! If you want "all x to have equal probability", call it p, then either p>0, in which case the integral (sum) of the distribution is obviously infinite, when it should be 1. But if p=0, the integral is 0, which is again wrong.