ID of last created category

There’s no 100% reliable way of doing this, as no date or timestamp is attached to the category in the database table. Any solution you find would be a partial solution that will never work 100%

The closest available would be these answers:

https://stackoverflow.com/questions/2770600/mysql-select-the-last-inserted-row-easiest-way

By assuming the category with the highest term ID was the last one added, you may have a mostly reliable heuristic to follow, but it’s not foolproof and may fail. To do this you’d need to make an SQL query on the terms table specifying only categories looking for the last ID with queries such as:

SELECT MAX(term_id)
SELECT LAST_INSERT_ID()
ORDER BY term_id DESC LIMIT 1

However at this point you now have an SQL question

To implement a 100% working solution you would need to hook into the term creation, then store the timestamp somewhere, then query it, but without term meta, there’s nowhere obvious to store it that will scale and be performant