A custom ROM is available for the Samsung Galaxy F22 that enables Samsung DEX on the Galaxy F22, a budget smartphone that does not comes with DEX functionality.

Download and install a custom recovery (TWRP) for Galaxy F22.
Download the ROM flashable zip from here.
Reboot to recovery: to do so power off your device, connect it to a computer via an USB cable and hold both volume up and power on buttons.
If you desire to restore back your currently installed ROM, make a backup of the following partitions: Boot, Super.
Wipe your cache partition before flashing the ROM (Wipe->Advanced Wipe->Cache);
Flash the ROM zip you previously downloaded.
Do not wipe data after the flashing ROM.
That is it. You now have Samsung DEX on the Galaxy F22. Keep in mind that you will loose all warranty once you have flashed this ROM. But since the F22 is already so old, you would have already lost the warranty anyway.