Let $p$ be an odd prime number and $\mathbb{Z}_{>0}$ be the set of positive integers. Suppose that
a function $f:\mathbb{Z}_{>0}\times\mathbb{Z}_{>0}\to\{0,1\}$ satisfies the following properties:
\begin{itemize}
\item $f(1,1)=0$;
\item $f(a,b)+f(b,a)=1$ for any pair of relatively prime positive integers $a,b$ not both equal
to 1;
\item $f(a+b,b)=f(a,b)$ for any pair of relatively prime positive integers $(a,b)$.
\end{itemize}
Prove that
$$\sum_{n=1}^{p-1}f(n^2,p) \geqslant \sqrt{2p}-2.$$