$f(x)=x^m+1$ is irreducible in $\mathbb{Q}[x]$ if only if $m=2^n$. I have a question

Prove that : $f(x)=x^m+1$ is irreducible in $\mathbb{Q}[x]$ if only if $m=2^n$

Thanks for your helps!
This is a consequence of the identity
$$
x^{(2n+1)2^m} + 1
= (x^{2n+1} + 1) 
(x^{(2n+1)(2^{m} - 1)}
- x^{(2n+1)(2^{m} - 2)}
 + \dots -1)
\\= (x^{2n+1} + 1)  \sum_{k=1}^{2^m}(-1)^{k-1} x^{(2n+1)(2^{m} - k)}
$$
It's not true. If you take $f(x)=x^{6}+1$, it's irreducible in $\mathbb{Q}[x]$ but $6$ is not a power of $2$. I think you want $f(x)$ irreducible iff $m=2n$.