We sometimes (when !!??) have a second adjoint pair (f_!,f^!) between the sheaf categories where f_! is direct image with proper support and f^! is a right adjoint. Now when f is proper on has f_!=f_* , so f^! is right adjoint to f_* .
You can find out what it does by adjoint yoga with the sheaf-Homs: Hom(f_*F,G)=Hom(F,f^!G).
Set F=O_X. Then (f^!G)(U)=Hom(O_X(U), f^!G(U))=Hom((f_* O_X)(U), G(U)). If you can determine the latter you know more. This is a very general answer, but it can help in concrete situations, boiling down the question to the knowledge of f_*O_X...
If you don't know whether the right adjoint exists, you can also try to define one via this equation.

