Disclaimer: I used to work in HFT

Each exchange is basically its own world, with the exception of Reg NMS, which I'll get to in a sec.

Let's task about order books. Each stock has its own order book. This might be an example of the book for AAPL:

* SELLING 100 shares @ $10.02
* SELLING 200 shares @ $10.01
* SELLING 100 shares @ $10.00
* BUYING 100 shares @ $9.99
* BUYING 200 shares @ $9.98
* BUYING 100 shares @ $9.97

So if you want to buy some AAPL, you will want to go grab the cheapest shares you can see, which here is the fellow selling 100 shares at $10.00. You submit a limit order to buy at 10.00 and are matched with that guy. The book now looks like this:

* SELLING 100 shares @ $10.02
* SELLING 200 shares @ $10.01
* BUYING 100 shares @ $9.99
* BUYING 200 shares @ $9.98
* BUYING 100 shares @ $9.97

Now let's suppose a market maker decides they think the price is going to follow, so they go and fill in the hole by submitting an order to BUY 100 shares at 10.00. There's no more shares to buy at $10.00, so their order rests on the book.

Now we have:

* SELLING 100 shares @ $10.02
* SELLING 200 shares @ $10.01
* SELLING 100 shares @ $10.00
* BUYING 100 shares @ $10.00
* BUYING 100 shares @ $9.99
* BUYING 200 shares @ $9.98
* BUYING 100 shares @ $9.97

Now that we've played out this scenario, let's go back to your original question. What is the price of AAPL at any point in here? Well, it depends. At the start, if you wanted to buy, you could say the price is $10.00. But if you wanted to sell, the best you'd get is 9.99. So, hard to say.

It's worth noting that the prices you see in the book are only there because people aren't agreeing on the prices. If they did agree, a trade would happen, and the prices wouldn't be on the book. So, with that in mind, you could say that really, the price of a stock is the last price people agreed at: the last trade price. That's better, we're at least down to just one price to think about.

That could be quite different from what the best bid/offer are right now, though (some stocks don't trade very often) so even if (let's say) you last saw AAPL trade at 9.50 before our example, obviously that price is long gone. So even the last trade price is potentially not "the price of the stock".

So, in short, there's really no such thing as "the price of a stock". It'll all depend on how sophisticated you want to be about the price at which you buy your shares.

When people talk generally about the price of a stock, it's usually just up to whatever site people are looking at, and usually markets are liquid enough and trade enough that all the kinds of prices we just talked about are usually only a penny different, so when people are just at the watercooler saying "Did you see the price of AAPL?" they don't care about the pennies, and by the time they've managed to say that question, the price has moved anyway, probably lots of times. So it all gets a little hand-wave-y.

I want to mention two other things that might interest you. Reg NMS is what ties all the exchanges together, so to speak. Let's say you want to buy AAPL and NYSE has shares selling at $10.00 each, but NASDAQ has them for $9.99 each. It's actually illegal (against Reg NMS) to trade with that guy at $10.00 at NYSE because NASDAQ has the "NBBO" (national best bid/offer) right now. Extra caveat: if you sent a special order to NYSE that says "I promise you, I've also sent an order to NASDAQ to buy the shares for $9.99 and I've determined you're the next best price at $10.00, let me buy them", it'll let you. It's called an ISO (Intermarket Sweep Order) and if you lie about them or mistakenly lie about them, you get fined. A lot.

The other interesting thing: Your last question was "If a very low-volume stock is listed at $4, and then I offer to buy a share for $100, does the NYSE suddenly start listing its price at $100?" There's actually a lot to unpack here. Let's go through it.

If you're a registered broker-dealer and are connected directly to NYSE, and you send a limit order for XYZ @ $100/share, what's going to happen is you're going to get "price improvement" and you'll end up getting the shares at $4. If you send an order for LOTS of shares at $100, you'll clear out a bunch of price levels in one go. Ex:

Let's say this is the book for XYZ:

* [...]
* SELLING 200 shares @ $110.00
* SELLING 1000 shares @ $5.00
* SELLING 200 shares @ $4.02
* SELLING 100 shares @ $4.01
* SELLING 500 shares @ $4.00
* BUYING 100 shares @ $3.99
* [...]

Usually when you get away from the middle of the book, liquidity dries up fast and the prices get further apart. So let's say you send an order for 10000 shares at $100. You're going to get 500 at $4, 100 at $4.01, 200 at $4.02, 1000 at $5.00. Now the next price is 110, but your limit price is 100. So your order will now actually rest partially-filled on the book. So now this is the book:

* [...]
* SELLING 200 shares @ $110.00
* BUYING 8200 shares @ $100.00
* BUYING 100 shares @ $3.99
* [...]

Neat, huh? That was a lot of price movement. So yes, if you can send for enough shares and are willing to pay through a lot of price levels, you can move the price of the stock. Remember Reg NMS though - if more stock exchanges existed in our example, you'd also likely need to go get shares at them if they have a better price than the exchange you just moved the price at.

But let's now suppose you're NOT a registered broker-dealer, but are instead Joe A. Schmoe, a client of Charles Schwab Brokerage. You enter your order in your web browser and hit trade. Schwab has a legal obligation to fill your order, if possible, only at the NBBO. They could route your order right to an exchange, but instead, they will send your order to their friend, Citadel, who will have the opportunity to trade against your flow before it gets routed to the stock exchanges. Generally, this is good for you: they might decide your order represents good information and they want your shares. They could decide to fill your order themselves and sell you all 10000 shares you want. They're constrained by the NBBO though, so you get all 10000 shares at $4. For being the source of this order, Citadel pays Schwab some money. Usually practically a pittance, pennies, if that. Order flow is dirt cheap nowadays.

This is called "selling order flow" and lots of people find it scary, because it's not really super intuitive why someone would want to buy or sell the actual flow of orders. But it's actually pretty boring and more about high-level statistics than anything actually interesting to Joe Schmoe, who would get bored when he realized he's not really getting ripped off.

Sorry, I got a bit off-topic. But I love finance, so please forgive me.