The trick here is to realize that because you're dealing with two ionic compounds, #"X"# cannot be a metal, i.e. it cannot be located in group 1 or group 2 of the periodic table.
In other words, you need #"X"# to accept electrons from copper to form anions, which are negatively charged anions. By comparison, copper will form cations, which are positively charged ions.
Likewise, #"X"# cannot be located in group 13 because elements located in this group form #3+# cations.
The only valid possibility is to have #"X"# located in group 17, the halogen group. In ionic compounds, halogens form #1-# anions because they only need one electron to complete their octet.
It's worth mentioning that copper, which is a transition metal, can have more than one valence. On the other hand, element #"X"#, which is a main-group element, cannot have more than one valence.
You will thus have
#"CuX " -> " Cu"^(+) + " X"^(-)#
#"CuX"_2 -> " Cu"^(2+) + " X"^(-)#