$f\in C^1(\mathbb R)$ , having finitely many zeroes and $f'$ changes sign at exactly two of these points , solutions of $f(x)=y$ for given $y$? Let $f:(0,1) \to \mathbb R$ be a continuously differentiable function having finitely many zeroes and $f'$ changes sign at exactly two of these points , then is it true that for any $y \in \mathbb R$ , the equation $f(x)=y$ has at most $3$ solutions ? 
 A: Let $p(x) = (x-1)^2(x-2)(x-3)(x-4)^2.$ Then $p$ is a polynomial of degree $6$ with roots at $1,2,3,4.$ Because of the signs of the factors we have $p>0$ on $(-\infty,1),$ $ p> 0$ on $(1,2),$ $p< 0$ on $(2,3),$ $p>0$ on $(3,4),$ and $p>0$ on $(4,\infty).$ (Good to start drawing a picture right about now.)
The double roots of $p$ at $1,4$ imply $p'(1)=p'(4) =0.$ Rolle's theorem tells us $p'=0$ at three other points - in the intervals $(1,2),(2,3),(3,4)$ respectively. Let's call these points $c_1,c_2,c_3.$ So we've identifed five roots for $p'(x),$ and since $p'$ has degree five, that is all of them.
It follows that $p'(2),p'(3) \ne 0.$ Hence $p'$ does not change signs at these zeros of $p$ (by continuity). What happens at $1?$ On $(-\infty,1),$ $p'$ must be positive or negative. Since $p> p(1)= 0$ on this interval, we have $p'<0$ there. On $(1,c_1)$ $p'$ must again be positive or negative. Since we move up from $p(1)=0$ to positive values, we must have $p'> 0$ on this interval. Therefore $1$ is a zero of $p$ where the derivative changes sign. The analysis at $4$ is exactly the same, with the same result.
The polynomial $p$ therefore satisfies the hypotheses. Is the conclusion true? No, for the simple reason that $p(x) = 0$ has four solutions. In fact, you can show without too much trouble that $p(x) = y$ has six solutions for small enough $y>0.$
