How do I write A-1 The minus one is small and at the top but I am new at algebra and this is the first time I had to use this.

You would write:

"A < s u p > -1 < / s u p > "
but without the double quotes and the intervening spaces.
In fact, this formula works for all superscripts.

Subscripts use the tag sub instead of sup.