Value of $f'(0)$ if $f(1/x)=0,\ \forall x \in \mathbb{N}$?

If there exists a continuous and differentiable $(\forall x \in \mathbb{R} )$ function $f:\mathbb{R} \rightarrow \mathbb{R}$ such that $f\left ( \frac{1}{n} \right )=0$ for every integer n not zero, then prove that $f'(0)=0$. [Here $f'(x)$ stands for derivative of $f(x)$ with respect to $x$]

An Attempt: Intuitive - In the neighbourhood of 0, there are (nearly infinite) dense numbers of the form $\frac{1}{n}$ and hence since the plot of $f(x)$ should pass through every zero like a wave or so, it seems to have intuitively concluded $f'(0)=0$.

But I fail to draw a good 'mathematical' proof in a formal way. Any such formal explanation?

• The hypothesis is false: $0$ is an integer and $f(1/0)$ is undefined, so there does not exist such a function $f$. Therefore you don't have to prove it. Apr 11, 2016 at 15:02
• @Robert Eagle eye! Edited. Apr 11, 2016 at 15:40

By continuity $f(0)=\lim_{n\to\infty}f(1/n)=0$. Let $a=f'(0)$. Then $\lim_{h\to0}\frac{f(h)-f(0)}{h}=a$. So for $\epsilon>0$ we find $\delta>0$ such that $|h|<\delta$ implies $\left|\frac{f(h)-f(0)}{h}-a\right|<\epsilon$. If we assume $a\ne 0$, we can let $\epsilon=|a|$ and conclude that in particular $\frac{f(h)-f(0)}{h}\ne0$ for all $|h|<\delta$. But we can certainly let $h=\frac 1n$ for some $n>\frac1\delta$; this leads to a contradiction as $\frac{f(1/n)-f(0)}{1/n}=0$. We conclude that $a=0$.

Firstly, we show

$$\lim_{x \to 0} f(x) = f(0) = 0$$

By continuity, this limit must exist. To prove this, suppose otherwise, that is, the limit is some $L \in \mathbb{R}$ such that $L \neq 0$. Choose $\epsilon$ such that $0 \notin (L - \epsilon, L + \epsilon)$. In every neighbourhood of $0$, $f$ vanishes, so for such $\epsilon$ we cannot find $\delta$. This is a contradiction, and hence $f(x) \to 0$ as $x \to 0$.

Using similar reasoning, we can conclude that

$$\lim_{x \to 0} \frac{f(x)}{x} = 0$$ which is the difference quotient, tends to $0$ as $x \to 0$. This limit exists by hypothesis.

Suppose otherwise, that it tended towards some $L \neq 0$ and consider $\epsilon$ where $0 \notin (L - \epsilon, L + \epsilon)$. The difference quotient vanishes an infinite number of times in any neighbourhood of $0$, so we cannot find a $\delta$. Contradiction, QED.