I understand you make money by buying low and selling high. But even if the stock price goes up, why are we guaranteed that there is some demand for it? After all, it's more expensive now. It would make sense if we can sell the stock back into the company for our share of the earnings, but why would other investors want it when the price has gone up?
For the same reason you wanted it when you bought it. No-one guarantees that you'll be able to sell the stock you hold, and in fact many people get stuck with stocks they'd like to sell, but no-one is buying. But if investors think there's a profit potential that is not exhausted yet - they'll want to buy the stock.
Imagine how foolish the people that bought Apple at $100 must have felt. It was up tenfold for the $10 it traded at just years prior, how could it go any higher?
Stocks have no memory. A stock's earnings may grow and justify the new higher price people are willing to pay. When FB came public, I remarked how I'd analyze the price and felt it was overvalued until its earnings came up. Just because it's gone down ever since, doesn't make it a buy, yet.
From an amateur:
Prices aren't entirely rational - they float, and the day to day prices of stock are an excellent example of this. So how would you assign an appropriate value to it? There is a logical minimum, the scrap value of the assets and the cash on hand. However, that doesn't take into account the expectations for growth people have for that company. If everyone thought a $100 mil company was going to be worth $200 mil by the end of next year, they'd still be willing to pay at a $150 mil price point now.
That said, the market is big enough that it's easy enough to find someone who has those growth expectations. They still expect it to be worth more in the future, and they'll buy it now. And if no one buys at that price point, that's when prices start to fall.
A few reasons. First, it's hard to buy a stock that has never gone up, and isn't necessarily wise to do so. Even if you just wait for a stock go down, what if you wait and it goes up two dollars, then drops 10 cents? Has it gone up or down? When should you buy it?
In general, your idea is correct, the higher the price the less you should want the stock. But in some sense, the past price is irrelevant, you can't buy it at the past price. You should buy it now if it's the best option now. And that is based on your assessment of whether it's future prospects are worth the current price (and in fact enough worth enough to make buying the stock the best economic decision you can currently make).
Finally, the price may have gone up for a reason. The company may have done something, or some information about the company may have become known, that affects it's future prospects. That might make it a better deal, perhaps even better than it was before the price increase.
"I understand you make money by buying low and selling high."
You can also make money by buying high and selling higher, short selling high and buying back low, short selling low and buying back even lower. An important technique followed by many technical traders and investors is to alway trade with the trend - so if the shares are trending up you go long (buy to open and sell to close); if the shares are trending down you go short (sell to open and buy to close).
"But even if the stock price goes up, why are we guaranteed that there is some demand for it?"
There is never any guarantees in investing or trading. The only guarantee in life is death, but that's a different subject. There is always some demand for a share or else the share price would be zero or it would never sell, i.e zero liquidity. There are many reasons why there could be demand for a rising share price - fundamental analysis could indicated that the shares are valued much higher than the current price; technical analysis could indicate that the trend will continue; greed could get the better of peoples' emotion where they think all my freinds are making money from this stock so I should buy it too (just to name a few).
"After all, it's more expensive now."
What determines if a stock is expensive? As Joe mentioned, was Apple expensive at $100? People who bought it at $50 might think so, but people who bought at $600+ would think $100 is very cheap. On the other hand a penny stock may be expensive at $0.20.
"It would make sense if we can sell the stock back into the company for our share of the earnings, but why would other investors want it when the price has gone up?"
You don't sell your stocks back to the company for a share of the earnings (unless the company has a share-buy-back arrangement in place), you get a share of the earnings by getting the dividends the company distributes to shareholders. Other investor would want to buy the stock when the price has gone up because they think it will go up further and they can make some money out of it. Some of the reasons for this are explained above.
You seem to prefer to trade like I do: "Buy low, sell high."
But there are some people that prefer a different way: "Buy high, sell higher."
A stock that has "just appreciated" is "in motion." That is a "promise" (not always kept) that it will continue to go higher. Some people want stocks that not only go higher, but also SOON.
The disadvantage of "buy low, sell high" is that the stock can stay low for some time. So that's a strategy for patient investors like you and me.