Typing an apostrophe in math mode gives a correctly raised prime, so f' is all you need. \prime exists for cases where the prime must be combined with another superscript, as in f'^{2} written as f^{\prime 2}.
All ways to write it
f'apostrophe; LaTeX converts itNo package neededf''double primeNo package neededf^{\prime}explicit, rarely neededNo package neededf^{(n)}nth derivativeNo package needed
Example
(fg)' = f'g + fg'The product rule.
Questions
How do I write a prime and a power on the same letter?
f^{\prime 2}, or {f'}^2 with the primed letter grouped.
Using prime in Confluence
Confluence Cloud has no built-in LaTeX. With LaTeX Math for Confluence you add a math macro to any page, type f' and it renders inline or as a block, with a live preview while you edit. Every command on this page renders there without extra packages.