The answer depends on whether you were married. If you were married then you can keep it. It’s yours.
But if you never married, you’ll need to give it back. The rules of contract law apply to a wedding proposal. The person giving the ring is offering it to the other person on the condition that they have a wedding. If you do not have a wedding, then there is a failure of the contract and the offer of the ring is revoked.
Some notable exceptions can be found when a ring is clearly given as a Christmas gift, Valentine’s Day gift, or birthday gift without a proposal accompanying.d
Or, if the ring was considered payment for financial agreements between the couple. That could include a down payment on a house, a loan, or living expenses. “I’ll propose to you if you could pay off my credit card.”
Talk to an attorney if someone owes you an engagement ring back or if you’re not sure whether you should give back your ring.