I know this equation: $\tau = J^T f$. In my case, the Jacobian $J$ is not square. Is it valid to use the pseudoinverse of $J^T$ to calculate end effector forces $f$ based on joint torques $\tau$? I have just never seen this equation used with given joint torques, this is why I am curious.
Short answer: you can use it.
Long answer: Depend on your case, but I have seen many papers where they use the pseudoinverse of the non-square Jacobian matrix.
The rectangular Jacobian matrix opens the window to optimize in terms of other variables such as space constraints or force minimization.
The pseudo inverse by definition (in a redundant manipulator) minimizes the joints velocities.