a. We know that if $t=\tan\frac{\theta}{2}$ then $\tan\theta=\frac{2t}{1-t^{2}}$ so $$ \cot\theta =\frac{1-t^{2}}{2t}=\frac{1}{2t}-\frac{t}{2}=\frac{1}{2\tan\frac{\theta}{2}}-\frac{1}{2}\tan\frac{\theta}{2}=\frac{1}{2}\cot\frac{\theta}{2}-\frac{1}{2}\tan\frac{\theta}{2}\\ \,\\ \implies\cot\theta+\frac{1}{2}\tan\frac{\theta}{2}=\frac{1}{2}\cot\frac{\theta}{2}\\\,\\ \implies\tan\frac{\theta}{2}=\cot\frac{\theta}{2}-2\cot\theta $$ b. For $n=1$ the formula holds by part a (by setting $\theta=x$ in the last line above). Suppose the formula holds for $n$. Let us show it also holds for $n+1$. We have (we use the induction hypothesis and the case of $n=1$ with $\theta=x/2^{n}$ in the 2nd and 3rd lines below) $$ \sum_{i=1}^{n+1}\frac{1}{2^{i-1}}\tan\frac{x}{2^{i}} =\sum_{i=1}^{n}\frac{1}{2^{i-1}}\tan\frac{x}{2^{i}}+\frac{1}{2^{n}}\tan\frac{x}{2^{n+1}}\\\,\\ =\frac{1}{2^{n-1}}\cot\frac{x}{2^{n}}-2\cot x+\frac{1}{2^{n}}\tan\frac{x/2^{n}}{2}\\\,\\ =\frac{1}{2^{n-1}}\cot\frac{x}{2^{n}}-2\cot x+\frac{1}{2^{n}}\Big(\cot\frac{x/2^{n}}{2}-2\cot(x/2^{n})\Big)\\\,\\ =\frac{1}{2^{n-1}}\cot\frac{x}{2^{n}}-2\cot x+\frac{1}{2^{n}}\cot\frac{x}{2^{n+1}}-\frac{1}{2^{n-1}}\cot\frac{x}{2^{n}}\\ \,\\=\frac{1}{2^{n}}\cot\frac{x}{2^{n+1}}-2\cot x $$ as desired.

c. We have $$ \lim_{n\to\infty}\sum_{i=1}^{n}\frac{1}{2^{i-1}}\tan\frac{x}{2^{i}} =\lim_{n\to\infty}\Big(\frac{1}{2^{n-1}}\cot\frac{x}{2^{n}}-2\cot x\Big)\\\,\\ =\lim_{n\to\infty}\frac{2}{x}\frac{x}{2^{n}}\cot\frac{x}{2^{n}}-2\cot x\\\,\\ =\frac{2}{x}\lim_{n\to\infty}\frac{\frac{x}{2^{n}}}{\tan\frac{x}{2^{n}}}-2\cot x\\\,\\ =\frac{2}{x}\lim_{t\to0}\frac{t}{\tan t}-2\cot x=\frac{2}{x}\frac{1}{1}-2\cot x=\frac{2}{x}-2\cot x $$ d. Finally if we put $x=\pi/2$ in the above relation we get \[ \sum_{i=1}^{\infty}\frac{1}{2^{i-1}}\tan\frac{\pi}{2^{i+1}}=\lim_{n\to\infty}\sum_{i=1}^{n}\frac{1}{2^{i-1}}\tan\frac{\pi/2}{2^{i}}=\frac{2}{\pi/2}-2\cot(\pi/2)=\frac{4}{\pi} \]