If X and Y are already compact, then their one-point compactifications either don't exist at all, or they just consist of an isolated point at infinity (depending on whose definition you want to use). In the latter case, can always be defined by taking

If you meant to say that X and Y arelocallycompact spaces, then the condition for to exist is that f should have a limit at in the space . In other words, there should exist such that, given any neighbourhood U of , there is a compact set such that for all .