I think what you are missing is that each time the client requests a number increase there is an independent request. Your inc_number handler would be coded as follows:
n = request.args.get('n', 0, type=int)
n = n + 1
Then from the jQuery side you have to invoke an independent Ajax request each time you want to increase the number.
Note that with this type of solution the jQuery app is the one that keeps track of the current value of the counter, and it has to send it to Flask with each request. Another possibility would be to have the Flask side remember the number in a user session. For that type of solution your Flask app would have two view functions:
from flask import session
# you need to set a SECRET_KEY in configuration, used to sign the user session
# store n in the user session
session['n'] = request.args.get('n', 0, type=int)
session['n'] = session['n'] + 1
With this solution now jQuery can set the number and not have to send it every time when it invokes inc_number.
I hope this helps.