Not the best solution... just a fix and I am not expected to accept it since it seems to be a bug of that fonts.
My suggestion is to use Asana Math... it is really so close that I don't think that their creator can recognize them (If are not just one creator). You can see it in my (not recommended) fix too that redefines j in a command for math.
\documentclass{scrbook}
\usepackage{unicode-math}
\setmainfont{TeX Gyre Pagella}
\setmathfont{TeX Gyre Pagella Math}
\def\f{\,f}
\begin{document}
Confirming the same problem for: TeX Gyre Termes Math ,
TeX Gyre Bonum Math. Seems ok: TeX Gyre Schola Math, STIX Math
and Latin Modern Math. And the good news for the end: Asana Math is
almost the same font without that problem. Test it!
\setmainfont{Asana-Math}\selectfont $Non$ TeX Gyre Pagella Test f
\setmainfont{TeX Gyre Pagella}\selectfont $\phantom{Non}$ TeX Gyre Pagella Test f
\setmathfont{Asana Math}\selectfont
\begin{equation}
\partial_x f(u),
\quad
\partial_j f^j(u),
\quad
uf
\quad
\partial_x u,
\quad
\partial_j u
\quad
q_j+q_f
\end{equation}
\setmathfont{TeX Gyre Pagella Math}\selectfont
\begin{equation}
\partial_x \f(u),
\quad
\partial_j \f^j(u),
\quad
u\f
\quad
\partial_x u,
\quad
\partial_j u
\quad
q_j+q_{f}%Here no space needed
\end{equation}
\end{document}
Output:
