Question: Let $P(z)=az^2+bz+c$, where $a,b,c$ are complex numbers.
(a) If $P(z)$ is real for all real numbers $z$, show that $a,b,c$ are real numbers.
(b) In addition to $(a)$ above, assume that $P(z)$ is not real whenever $z$ is not real. Show that $a=0$.
My approach: Given that $P(z)\in\mathbb{R}$, whenever $z\in\mathbb{R}$.
This implies that $P(0)=c\in\mathbb{R}$.
This also implies that $P(1)=a+b+c\in\mathbb{R}$ and $P(-1)=a-b+c\in\mathbb{R}$, which implies that $P(1)+P(-1)=2(a+c)\in\mathbb{R}\implies a+c\in\mathbb{R}\implies a\in\mathbb{R}.$
Again we have $P(1)-P(-1)=2b\in\mathbb{R}\implies b\in\mathbb{R}.$
Therefore, $a,b,c\in\mathbb{R}$. Hence we are done with part $(a)$ of the problem.
For the $(b)$ part I was trying to prove that $a=0$ by substituting $z=i$ and $z=-i$ in the given identity. But, couldn't get anything significant out of it.
Hints please.
If $a\ne0$, $P$ is a quadratic $\in\Bbb R[X]$, so its roots are two (possibly equal) reals or a complex conjugate pair, but (b) precludes the latter. Let $p,q$ be the roots of $P(z)$. So write $P(z)=a(z-p)(z-q)$. But for $t\in\Bbb R$ and $t\neq 0$,$$P((p+q)/2+ti)=-a((p-q)^2/4+t^2).$$