<|system|>
Let $n$ be a  positive integer and $a$ be an integer such that $a$ is its own inverse modulo $n$. What is the remainder when $a^2$ is divided by $n$?</s>.
<|user|>
Can you answer based on context?
<|assistant|>
Since $a$ is its own inverse modulo $n$, $a\equiv a^{-1}\pmod n$. Then \[a^2\equiv a\cdot a\equiv a\cdot a^{-1}\equiv 1\pmod n.\]