There exists no non-zero analytic function such that $f(\frac{1}{n})$=0 for all n
Im trying to prove by differentiability
If $f$ is differentiable it is continuous at $0$, So $f(0) = \lim f(\frac{1}{n}) = 0 = 0$
By definition of $f'(0)=f'(0) = \lim_{x \to 0} \frac{f(x) - f(0)}{x}$, so in particular
$$f'(0) = \lim \frac{f(1/n)}{0} = \infty$$
Which contradicts the differentiability of $f$.
Is my attempt is right or is we can prove By "Identity Theorem"
Your argument doesn't work. If it did, it would prove that there is no non-zero differentiable function $f\colon\mathbb{R}\longrightarrow\mathbb R$ such that $(\forall n\in\mathbb{N}):f\left(\frac1n\right)=0$. But such a function exists: define$$f(x)=\begin{cases}x^3\sin\left(\frac\pi x\right)&\text{ if }x\neq0\\0&\text{ otherwise.}\end{cases}$$Using the identity theorem is the natural way of proving that no such non-zero analytic function exists: since both $f$ and the null function are analytic functions which map each $\frac1n$ into $0$ and since the set $\left\{\frac1n\,\middle|\,n\in\mathbb N\right\}$ has an accumulation point (which is $0$), $f$ is eual to the null functions.