Let $R$ be a commutative ring, we define $J:=\bigcap_{\mathcal M \space \text{maximal}}\mathcal M$. Let $x \in J$, prove the following
$(1-x) \in \mathcal U(R)$
If $x^2=x$ then $x=0$
For the second, assuming the first item is true, then there is $r \in R \setminus \{0\}$: $(1-x)r=1 \implies (x-1)(-r)=1 \implies (x-1) \in \mathcal U(R)$. So $$x^2=x \space \text{iff}$$$$x^2-x=0 \space \text{iff}$$$$x(x-1)=0$$ Multiplying both sides by $(-r)$ yields $x=0$.
I am having problems proving the first proposition, I would appreciate hints for that part.
If $1-x$ is not invertible, then $(1-x)$, the ideal generated by $1-x$, is strictly contained in $R$ (why?) and therefore it is contained in a maximal ideal (why?).