First, what you are really asking for is typically called a complete invariant. A canonical or normal form also requires that $f(x)$ is equivalent to $x$ for all $x$. (Asking for a "representative" is a bit ambiguous, as some authors might mean this to include the condition of canonical form.)
Second, please forgive the shameless self-promotion, but this is exactly one of the questions Fortnow and I worked on [1]. We showed that if every equivalence relation that can be decided in $\mathsf{P}$ also has a complete invariant in $\mathsf{FP}$, then bad things happen. In particular, it would imply $\mathsf{UP} \subseteq \mathsf{BQP}$. If a promise version of this statement holds (see Theorem 4.6) then $\mathsf{NP} \subseteq \mathsf{BQP} \cap \mathsf{SZK}$ and $\mathsf{PH} = \mathsf{AM}$.
Now, if you actually want a canonical form (a representative of each equivalence class that's also in the equivalence class), we show even worse things happen. That is, if every equivalence relation decidable in polynomial-time has a poly-time canonical form, then:
- Integers can be factored in probabilistic poly time
- Collision-free hash functions that can be evaluated in $\mathsf{FP}$ do not exist.
- $\mathsf{NP} = \mathsf{UP} = \mathsf{RP}$ (hence $\mathsf{PH} = \mathsf{BPP}$)
There are also oracles going both ways for most of these statements about equivalence relations, due to us and to Blass and Gurevich [2].
If instead of "any" representative, you ask for the lexicographically least element in an equivalence class, finding the lexicographically smallest element in an equivalence class can be $NP$-hard (in fact, $P^{NP}$-hard) - even if the relationship has a polynomial-time canonical form [2].
[1] Lance Fortnow and Joshua A. Grochow. Complexity classes of equivalence problems revisited. Inform. and Comput. 209:4 (2011), 748-763. Also available as arXiv:0907.4775v2.
[2] Andreas Blass and Yuri Gurevich. Equivalence relations, invariants, and normal forms. SIAM J. Comput. 13:4 (1984), 24-42.