[proofplan]
The inclusion $\mathbb{Z} \subseteq \mathcal{O}_\mathbb{Q}$ is immediate since every $n \in \mathbb{Z}$ satisfies the monic polynomial $x - n \in \mathbb{Z}[x]$. For the converse, we exploit unique factorisation in $\mathbb{Z}$: if $\alpha = r/s \in \mathbb{Q}$ with $\gcd(r, s) = 1$ is an algebraic integer witnessed by a monic polynomial $f \in \mathbb{Z}[x]$, then clearing denominators in $f(r/s) = 0$ produces a relation that forces every prime divisor of $s$ to also divide $r$, contradicting coprimality unless $s = \pm 1$.
[/proofplan]
[step:Verify the inclusion $\mathbb{Z} \subseteq \mathcal{O}_\mathbb{Q}$]
For any $n \in \mathbb{Z}$ the polynomial
\begin{align*}
f(x) = x - n \in \mathbb{Z}[x]
\end{align*}
is monic of degree $1$ and satisfies $f(n) = 0$. By the definition of [algebraic integer](/page/Ring%20of%20Integers), this shows $n \in \mathcal{O}_\mathbb{Q}$. Hence $\mathbb{Z} \subseteq \mathcal{O}_\mathbb{Q}$.
[/step]
[step:Write $\alpha \in \mathcal{O}_\mathbb{Q}$ in lowest terms and extract a monic integer relation]
Let $\alpha \in \mathcal{O}_\mathbb{Q}$. Since $\alpha \in \mathbb{Q}$, we may write
\begin{align*}
\alpha = \frac{r}{s}, \qquad r, s \in \mathbb{Z}, \quad s > 0, \quad \gcd(r, s) = 1,
\end{align*}
where the representation is unique up to sign of $r$ by the fundamental property of $\mathbb{Q}$ as the fraction field of $\mathbb{Z}$. By definition of algebraic integer, there exists a monic polynomial
\begin{align*}
f(x) = x^n + a_{n-1} x^{n-1} + \cdots + a_1 x + a_0 \in \mathbb{Z}[x]
\end{align*}
with $f(\alpha) = 0$, where $n \geq 1$ and $a_0, \ldots, a_{n-1} \in \mathbb{Z}$.
[guided]
Let $\alpha \in \mathcal{O}_\mathbb{Q}$ and write $\alpha = r/s$ in lowest terms, meaning $r, s \in \mathbb{Z}$ with $s > 0$ and $\gcd(r, s) = 1$. Why insist on lowest terms? Because the argument below will derive a divisibility relation $s \mid r^n$, and we need to combine this with coprimality of $r$ and $s$ to conclude $s = 1$. If $r$ and $s$ shared a common factor $d > 1$, the relation $s \mid r^n$ would be trivial and useless.
By the definition of [algebraic integer](/page/Ring%20of%20Integers), there exists a monic polynomial
\begin{align*}
f(x) = x^n + a_{n-1} x^{n-1} + \cdots + a_1 x + a_0 \in \mathbb{Z}[x]
\end{align*}
with $f(\alpha) = 0$. Monicity — the leading coefficient is exactly $1$, not just some integer — is the crucial hypothesis that will let us turn a rational equation into a divisibility relation.
[/guided]
[/step]
[step:Clear denominators to produce a divisibility relation $s \mid r^n$]
Substituting $\alpha = r/s$ into $f(\alpha) = 0$:
\begin{align*}
\frac{r^n}{s^n} + a_{n-1} \frac{r^{n-1}}{s^{n-1}} + \cdots + a_1 \frac{r}{s} + a_0 = 0.
\end{align*}
Multiplying both sides by $s^n$ (which is a nonzero integer, so this is a valid operation in $\mathbb{Q}$):
\begin{align*}
r^n + a_{n-1} r^{n-1} s + a_{n-2} r^{n-2} s^2 + \cdots + a_1 r s^{n-1} + a_0 s^n = 0.
\end{align*}
Every term on the left except possibly $r^n$ has a factor of $s$, so
\begin{align*}
r^n = -s \left( a_{n-1} r^{n-1} + a_{n-2} r^{n-2} s + \cdots + a_1 r s^{n-2} + a_0 s^{n-1} \right).
\end{align*}
The bracketed expression is an integer (being a $\mathbb{Z}$-linear combination of products of integers). Therefore $s \mid r^n$ in $\mathbb{Z}$.
[guided]
Now we plug $\alpha = r/s$ into $f(\alpha) = 0$ and clear denominators. Substituting gives
\begin{align*}
\left(\frac{r}{s}\right)^n + a_{n-1}\left(\frac{r}{s}\right)^{n-1} + \cdots + a_1 \left(\frac{r}{s}\right) + a_0 = 0,
\end{align*}
which after multiplication by $s^n$ becomes
\begin{align*}
r^n + a_{n-1} r^{n-1} s + a_{n-2} r^{n-2} s^2 + \cdots + a_1 r s^{n-1} + a_0 s^n = 0.
\end{align*}
Look closely at this identity. Every term except the leading one carries at least one factor of $s$: the next term has $s^1$, then $s^2$, and so on. This is precisely because $f$ is **monic** — the leading coefficient is $1$, so the leading term after clearing denominators is $r^n$, clean of any $s$. If instead $f$ had leading coefficient $c \neq 1$, we would get a term $c r^n$ on the "clean" side, and the argument below would break.
Rearranging to isolate $r^n$:
\begin{align*}
r^n = -s\left( a_{n-1} r^{n-1} + a_{n-2} r^{n-2} s + \cdots + a_0 s^{n-1} \right).
\end{align*}
The right-hand side is $s$ times an integer, so $s$ divides $r^n$ in $\mathbb{Z}$. This is where monicity pays off: we have converted the polynomial relation into a pure divisibility statement in $\mathbb{Z}$.
[/guided]
[/step]
[step:Use coprimality of $r$ and $s$ to conclude $s = 1$]
We claim that $s \mid r^n$ combined with $\gcd(r, s) = 1$ forces $s = 1$. Suppose for contradiction that $s > 1$. Then $s$ has at least one prime divisor $p \in \mathbb{Z}$, and since $s \mid r^n$ we have $p \mid r^n$. By [Euclid's Lemma](/page/Euclid's%20Lemma) applied $n$ times (or directly by the fact that $\mathbb{Z}$ is a [unique factorisation domain](/page/Unique%20Factorisation%20Domain)), $p \mid r^n$ implies $p \mid r$. But then $p$ is a common divisor of $r$ and $s$, contradicting $\gcd(r, s) = 1$. Therefore $s = 1$.
[guided]
We have $s \mid r^n$ and $\gcd(r, s) = 1$; we want to conclude $s = 1$. Suppose $s > 1$ for contradiction. Then $s$ factors as a product of primes in $\mathbb{Z}$, so in particular $s$ has at least one prime divisor $p$. Since $s \mid r^n$, also $p \mid r^n$. Now we invoke the key property of primes in $\mathbb{Z}$: primes are precisely the irreducible elements, and $\mathbb{Z}$ is a [unique factorisation domain](/page/Unique%20Factorisation%20Domain). In a UFD, if a prime $p$ divides a product $a \cdot b$ then $p$ divides $a$ or $p$ divides $b$. Applying this inductively to $r^n = r \cdot r \cdots r$, we conclude $p \mid r$.
But now $p \mid r$ and $p \mid s$ means $p$ is a common divisor of $r$ and $s$, which contradicts $\gcd(r, s) = 1$. Our assumption $s > 1$ must be false, so $s = 1$.
Why is this final step — coprimality — non-negotiable? Because without it, the statement fails: take $\alpha = 2/2 = 1 \in \mathbb{Z}$, where before cancellation we have $s = 2$, $r = 2$, and indeed $2 \mid 2^n = r^n$ for all $n$. The argument works only when $r$ and $s$ share no common factor, so we must reduce to lowest terms first.
[/guided]
[/step]
[step:Combine both inclusions to finish]
From the previous step, $\alpha = r/s = r/1 = r \in \mathbb{Z}$, so $\mathcal{O}_\mathbb{Q} \subseteq \mathbb{Z}$. Combined with the first step's inclusion $\mathbb{Z} \subseteq \mathcal{O}_\mathbb{Q}$, we obtain $\mathcal{O}_\mathbb{Q} = \mathbb{Z}$, which is the desired equality.
[/step]