I just don't know how the term in the denominator $|e^{iφ} +i|^2$ got there obviously if we factor out the $i$ like $i(e^{iφ} +1)$ and then multiply the numerator and denominator by the conjugate of $(e^{iφ} +1)$ we could get a similar result but instead of $|e^{iφ} +i|^2$ i get $|e^{iφ} +1|^2$ also for the term $2Re(e^{iφ})$ wouldn't be instead $2Im(e^{iφ})$ $$f(e^{iφ}) = \frac {e^{iφ} − 1}{ie^{iφ} + i} = \frac {(e^{iφ} − 1)(e^{−iφ} + 1)}{i|e^{iφ} +i|^2} = \frac {{e^{iφ}}-{e^{-iφ}}}{i|e^{iφ} +i|^2} = \frac {2Re(e^{iφ})}{|e^{iφ} +i|^2} = \frac{2sin(φ)}{|e^{iφ} +i|^2}$$
this was taken from the book A First Course in Complex Analysis beck et al in example 3.5 so I don't know how right or wrong I am
This must be a typographical error: there is either a $1$ instead of $\Bbb i$ in the denominator, or the left bar of the modulus must also enclose the outer $\Bbb i$. Check for yourself: take $z=2$. Then clearly $f(2) \notin \Bbb R$, yet the computation they make gives a real result for every $z \in \Bbb C$. You are also right about the numerator. Your computations are the correct ones. Since we cannot suspect the authors of not being able to do something so simple, this must be some sort of editing mistake (they have probably mixed the statement of a problem with the solution for another - some sort of simple copy & paste error when writing the book).