Existence of utility representation of a rational but discontinuous preference This is related to Do discontinuous preferences imply no continuous utility function?

I think the title of the above-linked question is phrased in such a way that obscures a subtly different but more interesting question which the OP also hinted at in the body. I'd like to ask that explicitly here. 


  Does there exist a rational but discontinuous preference relation that is representable by a (potentially discontinuous) utility function?


In other words, if $\succsim$ satisfies completeness and transitivity but violates continuity, can we still find a utility function to represent it?

From known results, the answer does not seem obvious. 


We know that continuous utility representation exists if and only if preference is complete, transitive, and continuous. But this doesn't tell us what happens when preference is not continuous.
We know that utility representation does not exist for some discontinuous preference (e.g. the lexicographic preference). But can this conclusion be generalized? 


Finally, I want to note that the requirement for $\succsim$ to violate continuity means we're ruling out finite (and countable?) domains.
I think a basic problem is that any utility function defines a preference, and discontinuous utility functions can be used to define discontinuous preferences. Hence there are many discontinuous preferences that can be represented by utility functions.
An example:

Let $U(x,y)$ be a continuous utility function that maps from $\mathbb{R}^2$ to $(0,1)$. This latter may seem arbitrary, but the strictly monotononicaly increasing function $\frac{x}{x+1}$ maps from $\mathbb{R}_{++}$ to $(0,1)$, so it should be fine. Also define a closed set $H \subset \mathbb{R}^2$. Let
$$
\hat{U}(x,y)
=
\left\{
\begin{array}{ll}
U(x,y) &amp; \mbox{if} (x,y) \notin H \\
\\
U(x,y)+1 &amp; \mbox{if} (x,y) \in H.
\end{array}
\right.
$$
Obviously $\hat{U}(x,y)$ is not continuous and neither are the preferences defined by it. (The boundary of $H$ is prefered to anything outside $H$.) But the way these preferences were generated seems fairly general. So a large class of discontinuous preferences exists for which there is a utility representation.

Future question: How 'large' is this class, what measure can be used?

EDIT: As @NicolasPinto points out in his answer it is also necessary to specify that $H$ is such that
$$
\exists x \in H, \exists y \notin H: y \succ x,
$$
so $H$ is not the upper contour set of some point,
otherwise $U(x,y)$ and $\hat{U}(x,y)$ would in fact represent the same continuous preferences.