So basically, I’m looking for a set of constraints on a metric space $X$ such that every continuous function from $ X\rightarrow X$ has a fixed point. Obviously such metric spaces do exist, with the trivial example being $X = \{x\}$ (equipped with any metric), but I would be surprised if that was the only example.
At first I thought maybe it would be enough for $X$ to be compact and complete, but the unit circle is a counterexample to that.
The fixed point theorem of Brouwer might be what you're looking for
Conditions: X is compact and convex (in an Hilbert space - it's also true for Banach spaces by Schauder fixed point theorem )