Genericity of the zero set of a family of real valued functions For $n\in\mathbb N$ define
$$f(t) = \sin (nt) - g(t),\quad t\in[0,2\pi],$$
where $g$ is a (fixed) smooth function. I claim that $f$ has generically 
only finitely many zeros in $[0,2\pi]$, i.e. for almost every choice of $n$, the zero set of $f$ is finite. Does anyone have an idea how to tackle this question?
 A: Your question: 
"For $n\in\mathbb N$ define
$f(t) = \sin (nt) - g(t),\quad t\in[0,2\pi]$,
where $g$ is a (fixed) smooth function. I claim that $f$ has generically only finitely many zeros in $[0,2\pi]$, i.e. for almost every choice of $n$, the zero set of $f$ is finite." 
I think that as stated there is a counterexample to the above claim. 
Pick a sequence of $\varepsilon_n>0$, for $n\ge1$ with the following properties:
1. We have $\frac{2\pi}{n+1}+\varepsilon_{n+1}<\frac{2\pi}n-\varepsilon_n$ (so that the closed intervals
$[\frac{2\pi}n-\varepsilon_n,\frac{2\pi}n+\varepsilon_n]$, $n\ge1$, 
would be pairwise disjoint), and
2. The function $\sin (nt)$ (as a function of $t$) sends the interval 
$[\frac{2\pi}n-\varepsilon_n,\frac{2\pi}n+\varepsilon_n]$
onto a set contained in $[\frac{-1}{n^2},\frac{1}{n^2}]$ (and we may also assume, for convenience,
that $\sin (nt)$ is monotonically increasing on $[\frac{2\pi}n-\varepsilon_n,\frac{2\pi}n+\varepsilon_n]$).
(Better yet, require that $|\sin (nt)|\le t^2$ for 
$t\in[\frac{2\pi}n-\varepsilon_n,\frac{2\pi}n+\varepsilon_n]$, this could be
achieved by picking the $\varepsilon_n$ small enough.) 
Let $g_n(t)= \sin(n t)$ for $t\in [\frac{2\pi}n-\varepsilon_n,\frac{2\pi}n+\varepsilon_n]$. So the $g_n$ are a sequence of functions with disjoint domains, 
all domains contained in $[0,2\pi]$ (throw out the piece that sticks out to 
the right of $2\pi$, it is not needed). 
Construct a function $g$ that extends all $g_n$ and is differentiable on 
$[0,2\pi]$ (with one-sided derivative at the end-points). To do this, we define 
$g(0)=0$ and define $g$ in a suitable way in each interval 
$(\frac{2\pi}{n+1}+\varepsilon_{n+1},\frac{2\pi}n-\varepsilon_n)$ 
(so the derivative of $g$ at the end-points $\frac{2\pi}n\pm\varepsilon_n$ coincides with the corresponding one-sided derivative of $g_n$), and of course 
$g$ is already defined as $g_n$ on $[\frac{2\pi}n-\varepsilon_n,\frac{2\pi}n+\varepsilon_n]$. The extension could be made so that $|g(t)|\le C t^2$ for some fixed $C>0$ so that the result would be $g'(0)=0$, so $g$ would be differentiable on 
$[0,2\pi]$. 
By construction, for each $n$, the zero set of 
$f(t) = \sin (nt) - g(t)$ contains the interval 
$[\frac{2\pi}n-\varepsilon_n,\frac{2\pi}n+\varepsilon_n]$ (so clearly 
it is infinite), showing that the claim does not hold.
It is not clear to me what you mean by the phrase 
"for almost every choice of $n$" in the statement of your claim, perhaps 
"for all but finitely many $n$" though there are other meaningful interpretations involving small subsets of $\mathbb N$ (e.g. along the lines of "density zero"), 
but clearly any meaningful interpretation ought to be violated by this example as the set of zeros is finite for no $n$ whatsoever. 
On the other hand I believe the Claim would hold if we assume in addition 
that $g$ is analytic on $[0,2\pi]$. In this case if for some $m$ the zero set of 
$f(t) = \sin (mt) - g(t)$ is infinite, then $f$ is identically $0$, that is 
$g(t)=\sin(m t)$ for all $t$. In this case we could use that if $n\not=m$ then 
the zero set of $\sin (nt) - \sin (mt)$ is finite, considered on the interval $[0,2\pi]$ only.  Thus, the zero set of 
$\sin (nt) - g(t)=\sin (nt) - \sin (mt)$ is finite for all $n$, with only 
one exception when $n=m$.
This satisfies the "for all but finitely many $n$" interpretation 
of the phrase
"for almost every choice of $n$" (and it would likely satisfy 
other meaningful interpretations). 
The details of how to (simultaneously) extend (all) the $g_n$ 
to a function $g$ would be similar to
the usual construction of a $C^\infty$ function $h$ that is not analytic:
$h(t)=0$ for $t\le 0$ and $h(t)=\exp(\frac{-1}{t^2})$ for $t>0$. (For that matter, 
if I also want $g$ to be $C^\infty$ at $0$ then I need to modify condition 2 above, 
e.g. by requiring that $|\sin (nt)|\le \exp(\frac{-1}{t^2})$ for 
$t\in[\frac{2\pi}n-\varepsilon_n,\frac{2\pi}n+\varepsilon_n]$, 
so as to eventually get $|g(t)|\le C \exp(\frac{-1}{t^2})$ for some fixed $C>0$.) 
