If $f$ is a surjective mapping ,then prove that the range of $a$ is $0Let $f:D\to R$ be defined as $$f(x)=\frac{x^2+2x+a}{x^2+4x+3a}$$ where $D$ and $R$ denote the domain of $f$ and the set of all real numbers respectively.If $f$ is a surjective mapping ,then prove that the range of $a$ is $0<a<1$ 

In this question,the domain of the function is not given explicitly,but as the function is a surjective function,so the codomain and the range of the function are equal,so the range of the function is the set of all real numbers.
Then i tried to find the range of the function but i could not find that as $a$ is unknown and i am stuck here.Please help me.Thanks.
 A: Write
$$
f(x)=\frac{x^2+4x+3a-2x-2a}{x^2+4x+3a}=1-2\frac{x+a}{x^2+4x+3a}
$$
Then $f$ is surjective if and only if $g$ is surjective, where
$$
g(x)=\frac{x+a}{x^2+4x+3a}
$$
If $-a$ is not a root of the denominator, that is $a^2-a\ne0$, $0$ belongs to the image. Otherwise the function $g$ is not surjective.
Now, assuming $a\ne0$ and $a\ne1$, surjectivity of $g$ is equivalent to the equation
$$
x^2+4x+3a=b(x+a)
$$
having solution for any $b\ne0$. This means the discriminant is nonnegative:
$$
b^2+(4a-8)b-12a+16\ge0
$$
Thus the discriminant of the polynomial $b^2+(4a-8)b-12a+16$ (in the variable $b$) must be nonpositive.
A: I give some hints. (I suppose that $D\subset \mathbb{R}$).
a) Show that $a=0$ and $a=1$ are not solutions.
b) Write that $0$ is in the range, and obtain $a\leq 1$, hence $a<1$. Write $1/2$ is in the range, to obtain $a>0$. 
c) Now we suppose that $a\in ]0,1[$. You must have that the equation $x^2+2x+a-b(x^2+4x+3a)=0$ has a solution verifying $x^2+4x+3a\not =0$ for all $b\in \mathbb{R}$. I leave to you the case $x^2+4x+3a=0$. Now this is a degree $2$ polynomial in $x$. Compute the discriminant $\Delta$ of this polynomial. $\Delta$ is a polynomial of degree $2$ in $b$, with coefficients depending on $a$. Compute the discriminant $\Delta_1$ of this new polynomial . What is the sign of $\Delta_1$ ? 
