TITLE: A solution of a second order homogenous ODE has infinite zeros on a closed interval is $y=0$
QUESTION [6 upvotes]: We have the ODE $y''+p(x)y'+q(x)y=0$, the functions $p(x)$ and $q(x)$
  continuous on a closed interval $[a,b]$. Prove that if the solution
  $y(x)$ has an infinite number of roots ($x$s such that $y(x)=0$) on
  the interval $[a,b]$, then $y(x)=0$.

I tried negating the claim, saying there is an $x_0$ such that $y(x_0)\neq 0$, but got nowhere.
A hint or a direction of thought would be appreciated.

REPLY [7 votes]: Choose a sequence $\{x_n\}_{n=1}^{\infty}$ of distinct roots of $y$ so $y(x_n) = 0$ and $x_n \in [a,b]$. Since $[a,b]$ is compact, the sequence $\{ x_n \}_{n=1}^{\infty}$ has a convergent subsequence which we will still denote by $\{ x_n \}_{n=1}^{\infty}$ with $x_n \to x_0$ and $x_0 \in [a,b]$. Since $y$ is continuous, we have $y(x_0) = 0$. 
Consider 
$$ y'(x_0) = \lim_{x \to x_0} \frac{y(x) - y(x_0)}{x - x_0} = \lim_{x \to x_0} \frac{y(x)}{x - x_0}. $$
The limit exists and so we can calculate it using an arbitrary sequence approaching $x_0$. Since the $x_n$ are distinct, then by throwing at most one element from the sequence we can assume that $x_n \neq x_0$ for all $n \in \mathbb{N}$. Calculating the derivative using $\{ x_n 
\}$, we get
$$ y'(x_0) = \lim_{n \to \infty} \frac{y(x_n)}{x_n - x_0} = \lim_{n \to \infty} \frac{0}{x_n - x_0} = 0. $$
The uniqueness of solutions to the initial value problem then guarantees that $y(x) = 0$ for all $x \in [a,b]$.