There is probably absolutely nothing you can do other than buy a new iPhone. Since a scammer convinced you to sign into the device with their account, you basically gave the phone to them. You could submit an Activation Lock removal request but the scammer has almost certainly set Lost Mode on the device and Apple will not reset a device in those conditions.
Apple can completely reset a device if a person can provide sufficient evidence of valid ownership. Read the requirements and steps for an Activation Lock support request at: https://al-support.apple.com/#/additional-support Apple says you need to have "proof of purchase documentation” and “proof of ownership documentation”, but does not detail what currently constitutes proof other than it “must include the product serial number, IMEI or MEID.” User reports on this community indicate that typically Apple will ONLY accept an original receipt issued by Apple or an Apple Authorized Reseller. Presumably this is the only kind Apple can authenticate against fraud since Apple is not involved in third party sales. Apple recommends that you "Keep your receipt after you buy an Apple device" --> Keep your receipt after you buy an Apple device - Apple Support
Note that the device cannot have Lost Mode set on it. If your device has been taken over by you having entered a scammer’s Account then the scammer may have set that too and the device is lost to you.
If you cannot get the device unlocked then read this section from the very bottom of Apple Trade In - Apple :
"Does Apple offer recycling?
Yes. Apple Trade In lets you recycle any Apple device (including devices from Apple-owned brands) at any Apple Store and on Apple for free. That includes your batteries and old electronic products as well as free, on-demand packaging recycling for our commercial, education, and institutional customers. When we receive your device, it will be thoroughly inspected to determine if components can be recycled or reused. Whether recycled or reused, all activities relating to the processing of your device will be managed in an environmentally responsible way."
And this one for future purchases: The All Too Common SAD Reality of Buying … - Apple Community