A generalization of the result above appears as Theorem 21 in Chapter 15 of Royden's *Real Analysis*, 3e (it is also in earlier editions, but I can't find it in my copy of the 4e).

For reference, here's the statement and an outline of the proof (which appears to be different from the one in Uri Bader's answer):

**Theorem:** Let $X$ be a complete separable metric space, $\mathscr{B}$ the family of Borel sets of $X$, and $\mathfrak{N}$ a $\sigma$-ideal of $\mathscr{B}$. If $\Phi$ is any $\sigma$-isomorphism of $\mathscr{B}/\mathfrak{N}$ onto itself, then there is a one-to-one mapping $\phi$ of $X$ onto itself such that $\phi$ and $\phi^{-1}$ are Borel measurable and $\Phi(A)=\phi^{-1}[A]$ modulo $\mathfrak{N}$.

**Proof:** By standard facts, we may assume that $X=[0,1]$. Let $\Phi$ be a $\sigma$-isomorphism of $\mathscr{B}/\mathfrak{N}$ onto itself. For each $\alpha\in\mathbb{R}$, let $A_\alpha=\Phi([0,\alpha))$. The family $\{A_\alpha:\alpha\in\mathbb{R}\}$ is what Royden calls a *soma*, namely it satisfies:

(i) $A_\alpha<A_\beta$ (in the usual ordering on $\mathscr{B}/\mathfrak{N}$) whenever $\alpha<\beta$, and

(ii) $A_\beta=\bigvee_{i} A_{\alpha_i}$ whenever $\alpha_i<\beta$ and $\lim_i \alpha_i=\beta$.

Then, $f$ defined by $f(x)=\inf\{\alpha\in\mathbb{R}:x\in A_\alpha\}$ is a Borel measurable function on $[0,1]$, and maps into $[0,1]$ since $A_\alpha=X$ for $\alpha > 1$. The map with this property is unique modulo $\mathfrak{N}$.

If $\Psi:\mathscr{B}/\mathfrak{N}\to\mathscr{B}/\mathfrak{N}$ is the map induced by $f$, namely $\Psi(B)=f^{-1}[B]$, then $\Psi=\Phi$, since they agree on the half-intervals $[0,\alpha)$ a fortiori and are both $\sigma$-homomorphisms.

Likewise, there is a Borel measurable map $g:X\to X$ which induces $\Phi^{-1}$. Moreover, $g\circ f:X\to X$ induces the identity $\mathscr{B}/\mathfrak{N}$, and so by a uniqueness property analogous to that for $f$, must be equal to the identity function modulo $\mathfrak{N}$.

It remains to modify $f$ on sets in $\mathfrak{N}$ and make it into a bijection. Let $X_0$ and $Y_0$ be sets in $\mathfrak{N}$ such that $f$ is a bijection $X\setminus X_0\to X\setminus Y_0$ (with inverse $g$). Put $Z_0=X_0\cup Y_0$, and inductively define $Z_n$ by $Z_{n+1}=f[Z_n]\cup f^{-1}[Z_n]$. By induction, each $Z_n\in\mathfrak{N}$. Put $Z=\bigcup_n Z_n$, so $Z\in\mathfrak{N}$, $f[Z]\subseteq Z$ and $f^{-1}[Z]\subseteq Z$. Then, $f$ is a bijection from $X\setminus Z$ onto itself.

Define $\phi:X\to X$ by $\phi(x)=f(x)$ if $x\in X\setminus Z$, and $\phi(x)=x$ if $x\in Z$. Then, $\phi$ is as desired.