Is there a concept of inverting a non-invertible function by returning a set of the possible solutions?
For example:
$g(x) = x^2$
Would it be possible to create an inverse function $f(y)$ where, for example:
$f(4) = \{-2,2\}$
(I'm pretty sure I'm going about this wrong, but I'm still learning so I don't know *how* I'm wrong)
This is a multivalued function (see especially the first example!), or multifunction, or set-valued function. A set-valued map, taking elements of $X$ and producing subsets of $Y$, is often denoted $f : X \rightrightarrows Y$.
It can also be denoted more literally by $f : X \to 2^Y$, as such maps can be thought of as (ordinary, single-valued) functions from $X$ to the power set of $Y$.
Finally, one could also view them simply as relations with a full domain.