Derivation (two-sided z-test as a LRT)

For $H_0: μ=μ_0$ vs $H_1: μ\neq μ_0$, the generalised likelihood ratio statistic is $$ \begin{align*} Λ(X) ={}& \frac{\sup_{μ\in \R} L_X(μ)}{L_X(μ_0)} \\ ={}& \frac{(2πσ^2)^{-n/2} \exp(-\frac{1}{2σ^2}\sum_{i=1}^{n} (X_i-\overline{X})^2)}{(2πσ^2)^{-n/2} \exp(-\frac{1}{2σ^2} \sum_{i=1}^{n} (X_i - μ_0)^2)}. \end{align*} $$ where we have used the maximum likelihood estimator $\overline{X}$. Then $$ \begin{align*} 2\log Λ = -\frac{1}{σ^2}\left(\sum_{i=1}^{n} (X_i-\overline{X})^2 - \sum_{i=1}^{n} (X_i - μ_0)^2\right) = \frac{n}{σ^2}(\overline{X} - μ_0)^2 = Z^2. \end{align*} $$ (Note this resembles Wilks' theorem.)

Therefore the likelihood ratio test rejects $H_0$ if $$ \begin{align*} Z^2 > c_α \end{align*} $$ where $c_α$ is chosen such that $\prob_{μ_0}(Z^2 > c_α) = α$. Since $Z\sim N(0,1)$, $Z^2 \sim χ_1^2$ so $c_α$ is the upper $α$ quantile of $χ_1^2$. Equivalently, reject if $$ \begin{align*} |Z| > z_{α/2} \end{align*} $$ where $z_{α/2}$ is the upper $α/2$ quantile of $N(0,1)$.