Let's say we have two metric spaces, $(X,\rho)$ and $(Y,\tau)$. The continuity of $f:X\to Y$ is obvious and natural to define. What about semi-continuity? Without a natural ordering on $Y$, perhaps "upper" and "lower" won't make sense anymore. But are there other, weaker notions of continuity such that $f$ is continuous iff it is continuous in all of those weaker senses?



Metric analogue of upper/lower semicontinuity
A "weak" generalization of continuity for a function $f:X\rightarrow Y$ with values in a metric space:
for each fixed $y\in Y$, consider the real valued function $f\_y:x\mapsto d(f(x),y)$;
for $f$ to be continuous each $f\_y$ must be continuous
(i.e. both upper and lover semicontinuous).


"Weak" here means that it is exactly the idea of weak topologies in functional analysis,
but this is also the idea for an embedding or a metric space in a space of continuous functions
(as used in a exercise in Rudin's "principles")


I want to show now that this kind of idea is used in a wide spectrum of mathematical contexts
(corollary: the idea might be too general for your needs, but perhaps with specific needs in mind it can be concretized).


Suppose we have a class $A$ of structures [like metric spaces], and a class $B$ of "nicer" structures [the reals], and three notion of morphisms:
a general one between $A$-structures [continuous maps], another general one between $B$-structures [the identity], and a "nicer" one from a $A$-structure to a $B$-structure
[the maps of the form "distance from a fixed point" for a suitably compatible (pseudo)metric];
assume the obvious compatibility conditions (two categories that act, one on one side and one on the other, on the set of "nicer" maps).


Then one can ask how much of the structure of a $A$-object can be recovered by knowing only the "nice" morphisms originating from the object.
[One can dualize the situation and consider "nice" maps towards $A$-structures].


(Another obvious, and perhaps generally more useful question: is there a universal morphism among the nice ones?
This is a "adjoint functor question" or "existence of a nice reflection/completion of a $A$-structure". But it is *not* the question directly posed here.)


This setting is very general, but is also effectively used:


The compactification theory (of completely regular T$\_0$ spaces, ore general ones) uses continuous maps to compact T$\_2$ spaces.
One recovers the structure of "completely regular T$\_0$ space" (or the (co?)reflection into such category for a general space),
and even maps towards the real interval $[0,1]$ are enough (family of (co?)generators in a category, in this case a single one).


Dually (continuous maps from T$\_2$ compact spaces) one has the theory of $k$-spaces (a common generalization of sequential and locally compact T$\_2$ spaces);
A. Weil thought (see his commentaries in his collected papers) that a better setting for "Bourbaki like" measure theory, one the compact T$\_2$ case is known, is not a locally compact T$\_2$ space but
a set equipped with a collection of compact subsets (a slight variation of the above, and again expressible in this general setting).


A (real, infinitely or only continuously) differentiable structure is known when one knows the "nice" (differentiable) maps from the reals
(differentiable paths, even the ones with "stop points" where the differential is 0) or dually the "nice" functions from the manifold to the reals.
This (is equivalent to the usual way for finite dimensional manifolds, thanks to a theorem known since 1969, and) has be used to generalize the
notion of Banach manifold to obtain a theory that works better that the old attempts using locally convex spaces.


To obtain analytic manifolds or complex manifolds, everywhere defined "nice" maps are not enough. One can generalize the setting (sheaf of rings of "nice" functions);
a variation that is useful for settings other than "analytic manifolds" uses a filter of "dense" subsets
(open dense sets in a topological space, dense G$\_\delta$ sets in a Baire space, co-null sets in a (finitely or countably additive) positive measure space)
and "nice" maps defined on them, identified when they agree on a "nice dense" set. One obtains representation theorems for vector lattices (and even lattice ordered, or even directed, abelian groups)
for with suitable completeness assumptions (and then weaker representation theorems for such structures that have a completion, the "integrally closed" condition being the necessary and sufficient one for completability).
One uses such kinds of "nice dense subsets" also in algebra, in the theory of rings of quotients (huge generalization of the usual embeddings of a commutative domain in a field), and torsion theories for modules.


Also in algebra, specifically in ring theory, taking as "nice" the morphisms from a commutative associative ring, one sees that one recovers only the Jordan ring structure
($a\circ b=(ab+ba)/2$) of an associative ring with $1/2$ (in sufficiently indecomposable cases that means that one recovers the ring up to isomorphisms or anti-isomorphisms).
With morphisms from boolean algebras, seen as "observables", one can define quantum logics.


So, returning to your case, for any special kinds of (continuous) maps from a metric space to the reals, one can treat them as "nice" in the above setting,
and study the $f:X\rightarrow Y$ such that for any "nice" map on $Y$ the composition with $f$ gives a "nice" map on $X$, or only a weak form of it, like
a semicontinuous map. It might be that, when a specific application is in mind, a specific useful concept of "nice" naturally arises.


Edit: I now see that while I was writing my answer in the comments other different proposals had been made. These proposals are quite surely better for your specific needs. Sorry for the noise, if you want I delete this answer (which was really meant to be a comment, but it is impossible to decently format long comments).


