I was reading Jehle and Reny, Advanced Microeconomic Theory, where they discuss in detail, the choice problem of a consumer. The Consumption Set (or Choice Set) $X$ is a subset of $R_+^n$, is closed and convex and contains $0\in R_+^n$. They define a preference relation $\succeq$ on $X$ that satisfies completeness, transitivity and continuity. Then they argue that these conditions are sufficient for the existence of a continuous real-valued utility function that represents the preference relation $\succeq$.
I wondered if there are more general results about the existence of utility functions (continuous or not) to represent rational preferences. The theorem in Jehle and Reny has nothing to say about cases where the choice set does not satisfy the conditions assumed or when we simply do not care about the continuity of the utility function. For example, if $C= \{a, b, c\}$ is the choice set and the preference ordering is simply $a, b, c$ (the preference relation is accordingly defined), then $u: C\rightarrow R$, $u(a)=10, u(b)=2.5, u(c)=\frac{\pi}{100}$ is a legitimate utility function, but the theorem in Jehle and Reny does not say anything about these cases. Again, the famous lexicographic preferences (that satisfy rationality but violate continuity) have no utility functions, but Jehle and Reny's theorem does not tell us anything about it. I wanted to know the most general necessary and sufficient conditions for the existence of utility functions, that also cover these and other possible cases.
Formally, let $C$ be the set of all conceivable choices (no conditions on it assumed so far), and let $\succeq$ be a binary relation on $C$ that satisfies completeness and transitivity.
What are the necessary and sufficient conditions that $C$ and $\succeq$ must satisfy, so that a utility function from $C$ to $R$ that represents $\succeq$ exists?
I would appreciate both proofs and/ or reference materials for this, or even partial solutions.