When working with machine learning models I came across a regression model that has 2 integer outputs for which the order doesn't matter. It would be convenient to map this two outputs into one real one such that the integers can be recoverd from this real number. Thus the question:
Is there any function $*:\mathbb{Z}\times\mathbb{Z}\to\mathbb{R}$ with associated map $A:Im(*)\to\mathbb{Z}\times\mathbb{Z}$ such that for any $p,q\in\mathbb{Z}$ $$A(p*q)=(p,q) \vee A(p*q)=(q,p)$$
If "$X \vee Y = Z$" means just that at least one of $X, Y$ is $Z$ then all you are really asking is that $$ A(p*q) = (q,p) $$ since then $$ (p,q) \vee (q,p) = (q,p) $$ will be true.
There are lots of pairs of functions $(*, A)$ that will do. You just have to encode a pair as a single number that uniquely determines both $p$ and $q$. Then let $A$ be the function for which $$ A(p*q) = (q,p) , $$
If there is a bound $b$ on nonnegative inputs just convert $(p,q)$ to a digit base $b$ integer: $$ p*q = pb + q. $$
For arbitrary integer inputs, setting $$ p*q = 2^p3^q $$ produces a rational number from which you can recover $p$ and $q$ by factoring.
If you want integer rather than a rational output use $2^p$ or $3^{-p}$ depending on the sign of $p$, and a power of $5$ or $7$ to encode $q$.
There are many other strategies. Picking one that works best for the application depends on context you haven't provided.