First, observe that $f$ as stated is not always well-defined: we don't know its values on rational numbers which are not in the sequence $\left(\frac{p_{n}}{q_{n}}\right)$. I'm going to make the assumption that $\left(\frac{p_{n}}{q_{n}}\right)$ runs uniquely over all rational numbers (which we can do by picking an enumeration of them), so that $f$ is well-defined. Moreover, we can always choose $q_{n} > 0$ (by changing the sign of $p_{n}$ if necessary). We will assume rational numbers are always written in reduced form.
Let $g(x) = \frac{f(x)}{(x-\sqrt{2})^{2}}$. We want to show that $\lim_{x \to \sqrt{2}}g(x)$ exists, and to find its value. Observe that for any irrational number $\alpha \neq \sqrt{2}$, $g(\alpha) = 0$. So, if the limit exists, it should be $0$.
Now, recall Roth's theorem in Diophantine approximation, which states: for any irrational algebraic number $x$ and any real $\lambda> 0$, the inequality
$$\left|x - \frac{p}{q} \right| < \frac{1}{q^{2+\lambda}}$$ has only finitely many coprime integer solutions $(p, q)$. In particular, taking $x = \sqrt{2}$, $\lambda= \frac{1}{4}$, and squaring both sides, we see that only finitely many coprime integer pairs $(p, q)$ do not satisfy
\begin{equation}\tag{1}
\left(\sqrt{2} - \frac{p}{q} \right)^{2} > \frac{1}{q^{4+\frac{1}{2}}}.
\end{equation} Since we have an enumeration $\frac{p_{n}}{q_{n}}$ of the rationals, we can rephrase this as: there exists some $N$ so that for all $n > N$, $(p_{n}, q_{n})$ satisfies (1).
Therefore, for all $n > N$, we have
$$0 < g\left(\frac{p_{n}}{q_{n}}\right) = \frac{f\left(\frac{p_{n}}{q_{n}}\right)}{\left(\frac{p_{n}}{q_{n}}-\sqrt{2}\right)^{2}} = \frac{\frac{1}{q_{n}^{5}}}{\left(\frac{p_{n}}{q_{n}}-\sqrt{2}\right)^{2}} < \frac{\frac{1}{q_{n}^{5}}}{\frac{1}{q_{n}^{4+\frac{1}{2}}}} = \frac{1}{\sqrt{q_{n}}}.$$
Finally, we can conclude. Let $\epsilon > 0$ be arbitrary. There are only finitely many rational numbers $\frac{p_{n}}{q_{n}}$ with $n \leq N$, and none of these are equal to $\sqrt{2}$. There are also only finitely many rational numbers $\frac{p_{n}}{q_{n}}$ with $q_{n} \leq \frac{1}{\epsilon^{2}}$. Therefore, there exists $\delta > 0$ so that $(\sqrt{2}- \delta, \sqrt{2}+\delta)$ contains only rational numbers $\frac{p_{n}}{q_{n}}$ with $n > N$, and $q_{n} > \frac{1}{\epsilon^{2}}.$
For any rational number $\frac{p_{n}}{q_{n}} \in (\sqrt{2}- \delta, \sqrt{2}+\delta) \setminus \{\sqrt{2}\}$, we have
$$0 < g\left(\frac{p_{n}}{q_{n}}\right) < \frac{1}{\sqrt{q_{n}}} < \frac{1}{\sqrt{\frac{1}{\epsilon^{2}}}} = \epsilon.$$ Moreover, by the first computation, for any irrational number $x \in (\sqrt{2}- \delta, \sqrt{2}+\delta) \setminus \{\sqrt{2}\}$, we have
$$g(x) = 0 < \epsilon.$$
So, we see that for any real $x \in (\sqrt{2}- \delta, \sqrt{2}+\delta) \setminus \{\sqrt{2}\}$, we have $|g(x)| < \epsilon.$ Since $\epsilon$ was arbitrary, this proves that
$$\lim_{x \to \sqrt{2}} g(x) = 0,$$ as desired.
Remark: Observe that this proof still works if we replace $\sqrt{2}$ with any irrational algebraic number.