Yes, you have to depreciate your rental property. It is not optional.
Prior year depreciation is the amount allowed or allowable. Even if you did not claim it, you still have to reduce your basis, (and increase your gain), by the amount you should have claimed.
If you have not claimed depreciation in prior years, you should amend those returns to claim that depreciation.
It is also possible to file Form 3115, Change in Accounting Method, in the year of sale to claim all of the depreciation in the year of sale. But you are better off taking it in the prior years.
**Say "Thanks" by clicking the thumb icon in a post
**Mark the post that answers your question by clicking on "Mark as Best Answer"