I am new to option trading.

1. How do we know an option is ITM on the expiration date when the underlying asset price could fluctuate throughout the day?
2. If we short a call/put, understand that we "buy to close" to prevent the buying/selling of the underlying asset.

* a) But what if the buyer of the call/put refuses to sell back to the
writer?  

b) Or the buyer exercises the call/put before expiration?

Thank you