Solution:
If n is a power of 2 then there may be only one pile remaining; otherwise, there will be at least two piles remaining, but this can be attained. It is clear why you can reach one pile if n is a power of 2: the first n/2 piles can each receive pebbles from two piles with a pebble, the next n/4 piles can inherit two pebbles from two piles with two stones each and so forth, doubling each "generation".
Suppose n is not a power of 2 and write n=c2k, c>1. We claim there is always a pile with a number of pebbles not divisible by c. This is clearly true initially. Suppose it is not true at some point, and consider what happens when you next create a pile. If this pile does not receive some pebbles from the existing pile(s) possessing a quantity not divisible by c, then they will maintain the invariant. If instead the pile receives some x pebbles from them, then the pile will have 2x, but c does not divide 2x as c is odd and does not divide x. In particular, one can never reduce to a single pile, as n is of course divisible by c.
Finally, we show that you can always reach just two piles. This can be done via induction: Write n=2k+r, r<2k. If we get to a pile with r pebbles, then the remaining 2k pebbles can always be consolidated into one pile, irrespective of the initial distribution: we begin by having 2k−1 piles receiving 1 pebble from two piles, but not from each other, creating 2k−1 piles with 2 pebbles each, and then double each generation like above. To create a pile with r pebbles, we have two cases. If r<2k−1 then simply create two piles with 2k−1 pebbles by doubling, and then take away some pebbles from both of them so that they both have r pebbles, and set one of them aside. If r>2k−1 then create a pile with 2k pebbles and a pile with 2k−1, and again take away some pebbles from both of them so the larger pile has r pebbles. One can formulate an alternative induction argument where you use the fact n can be consolidated into two piles of size n−1 and 1, to show that n+1 can be consolidated into n+2 and 2 and then show via a number-theoretic argument that you can reach n+1 and 1 from here if n is odd.