Limit of the summand I learnt that if $\displaystyle\lim\limits_{x\mathop\to\infty}f(x) \ne 0$ or if the limit does not exist then $\displaystyle\sum_{x\mathop=1}^{\infty}f(x)$ diverges.

But suppose $f(x)$ takes the value of $0$ at every integer, and the value of $1$ everywhere else. Then the sum clearly converges to $0$, but the limit of the function does not exist. So isn't the statement incorrect?
The statement is indeed false, for the reason you've given.

Correct would be: if $\lim \limits_{x\to \infty}(f(x))\neq 0$ or $\lim \limits_{\substack{{x\to \infty}\\ x\in \mathbb N}}(f(x))$ doesn't exist, then $\displaystyle \sum \limits_{n=1}^\infty\left(f(n)\right)$ diverges.
i think that the statement "if $\displaystyle\lim\limits_{x\mathop\to\infty}f(x) \ne 0$ or if the limit does not exist then $\displaystyle\sum_{x\mathop=1}^{\infty}f(x)$ diverges" only applies to continuous functions or discrete functions defined at Integers.