Some friend showed me the following calculation that leads to an obviously wrong conclusion, but I can't find where it goes wrong: For $k\in \mathbb{R}\\ e^{\pi ik}=e^{\pi i \frac{k}{2}\times 2} =(e^{2\pi i})^{\frac{k}{2}}=1^{\frac{k}{2}}=1$
Which step is illegal?
If $\frac{k}{2}$ is a non-integer rational, then $z^{k/2}$ is a multi-valued function, and which value is meant here is ambiguous at best. If $\frac{k}{2}$ is irrational, the formula $(e^{2\pi i})^{k/2}$ doesn't even have a clearly defined meaning.