Problem with modular multiplicative inverse. I'm trying my best to solve one of my prep-exam exercises. I've got thesis that seems to be right (I've checked it on small numbers), but I cannot prove it ... . So here it is: $x \perp n $ and $x+1 \perp n.\, $ Let $\,x' = x^{-1}\bmod n.\,$ Prove that $ x' \perp n $ and $ x' + 1 \perp n $. First part with $ x' \perp n $ is easy, but second I cannot prove. Thanks for all help!
 A: While provable by manipulating Bezout equations, that  obscures the arithmetical structure at the heart of the matter - that $\color{#c00}{\text{divisors}}$ $\!\color{#0a0}{\text{ of invertibles remain invertible}}$. Let's bring that to the fore.
Recall by Bezout that $\,a$ is invertible $\!\bmod n\iff a\,$ is coprime to $n.\,$ Applying this below yields
$\!\bmod n\!:\ a$ invertible $\Rightarrow aa^{-1}\equiv 1$ so $a^{-1}$ is invertible (inverse $\equiv a)$ so $a^{-1}$ is coprime to $n$
Further, notice if $\,a \equiv \color{#c00}b\,c\,$ then $\,1 \equiv aa^{-1} \equiv b(ca^{-1})$ so $\,\color{#c00}b\,$ is $\color{#0a0}{\text{also invertible}}$ (with inverse $ca')$.
So invertible $\ x+1 \equiv (\color{#c00}{1+x^{-1}})x\,\Longrightarrow\,$ invertible $\,\color{#c00}{1+x^{-1}}.\,$  So both claims are obvious this way.
Remark $ $ The first claim can also be deduced this way, i.e. $\,aa^{-1}\equiv 1\,$ so $\,a^{-1}$ is a divisor of the invertible $1$ so it remains invertible.
Notice $\ b\mid a,\ a\,$ invertible $\Rightarrow b\,$ invertible is a special case of divisibility transitivity. viz.
namely $b\mid a\mid 1\Rightarrow b\mid 1.\,$ Compre the well-known formula $\,b^{-1}\equiv (ac^{-1})^{-1} \equiv ca^{-1}$
Thus the set of invertibles are closed under $\rm\color{#c00}{divisors}$ and product. Such an algebraic structure is known as a saturated monoid, and it it turns out to be very useful in number theory.
A: Let's denote $a=x \ mod^{-1} \ n$. There exists $b$ such that $ax + bn = 1$. This is clear, by Bezout, that $gcd(a,n)=1$.
For the second part now, by hypothesis there exists $c,d$ such that $c(x+1)+dn=1$. Then one has
$$ (a+1)cx + (bc+d)n = c(ax + bn) + cx + dn = c + 1-c = 1$$
so $gcd(a+1,n)=1$.
