It appears in the book of number theory, and I don't understand the proof actually. There is a corollary (from a theorem) that states that
Corollary If $x\in\mathbb{Q}, x\not = \dfrac{\pi}{2}+k\pi,\exists k\in\mathbb Z$. Then $\tan x\not\in\mathbb{Q}$.
The proof that $\pi$ is irrational (in the book) is that they assumed $\pi\in\mathbb Q$ and so is $\dfrac{\pi}{4}$ but $\tan\left(\dfrac{\pi}{4}\right)=1\in\mathbb{Q}$, which contradicts that $\tan (\pi/4)\not\in\mathbb Q$ from the corollary. I don't understand why we didn't use $\pi$ itself instead of $\pi/4$ as it satisfies the condition and yields the contradiction as well. I wonder that I miss some points in the case, so that the book has to use $\pi/4$?
For Lambert's proof see for example here, where he used $\tan(\frac{\pi}{4})=1$. As noted in this text, we could also have used $\tan(\pi)=0$ for the proof, but Lambert didn't. For a detailed account of this proof see also this post:
Lambert's Original Proof that $\pi$ is irrational.
Remark: It is funny, how many "difficulties" arise with this proof by Lambert, see for example
Proving $\pi$ irrational: help with Lambert's proof. "Circularity"?