Suppose $[a],[b],[c]\in\Bbb Z_n$, and are residue classes which satisfy $[a][b]=[1]$ and $[a][c]=[1]$. Prove $[b]=[c]$.
We have
$$\begin{align} [b]&=[b1]\\ &=[b]\color{red}{[1]}\\ &=[b](\color{red}{[a][c]})\\ &=([b][a])[c]\\ &=[ba][c]\\ &=[ab][c]\\ &=(\color{blue}{[a][b]})[c]\\ &=\color{blue}{[1]}[c]\\ &=[1c]\\ &=[c]. \end{align}$$
Since $n \mid ab - 1$, then $\gcd(a, n) = d$ means $d \mid 1$, so $d = 1$. Thus, $n \mid a(c - b)$ gives $n \mid c - b$, i.e., $b \equiv c \pmod{n} \implies [b] = [c]$.
We can cancel an invertible $\color{#c00}A$ by scaling by an inverse $B = A^{-1}\,$ (in any commutative ring)
Said explicitly: $\ B\times [\color{#C00}AB=\color{#c00}AC]\,$ yields $\, B = C,\,$ by $\,BA = 1.\ $ QED
Therefore $\rm\color{#c00}{invertible}$ elements are always cancellable.
Alternatively $\ B = B(AC) = (BA)C = C\ $ shows directly the sought uniqueness of inverses (the link explains one way to discover that standard slick proof vs. pull it out of a hat like magic).
OP is the special case $A = [a]$ etc in the commutative ring $\Bbb Z_n$. Note that the proofs above use only that the ring multiplication is associative and commutative $(BA = AB = 1)$ with neutral $1$.
Thus we needn't peek into the (private) internal structure of the ring elements (here cosets). Rather, the proof follows directly from the ring axioms. This is one of the major advantages of axiomatizing rings - we can use the axioms to prove ring laws that hold true for any ring, since we use only the general ring laws and not any special properties of the elements. Ditto for other familiar ring laws such as the Binomial Theorem, difference of squares factorization, etc. It is important to forget about the particular construction of $\,\Bbb Z_n\,$ and instead think about its elements as atomic elements (concrete numbers like integers, rationals, etc) whose essential algebraic properties are only how they are related to one another by the ring operations (i.e. by the addition and multiplication tables) - just as in familiar number systems (see here form much more on this key point of algebraic abstraction).
If you haven't yet learned about rings then you can still use the above general proofs by first showing that coset multiplication is commutative and associative (it's easy to prove that these ring laws are inherited from $\Bbb Z)$.
Remark $ $ Generally if $\,AB = BA=1$ then $AX =D$ has unique root $X = BD\ $ [OP is $D=1$]