I have a problem with the following (really) basic result:
$$A\backslash B=B\backslash A \Longleftrightarrow A=B$$
More specifically, I am able to prove it only by contradiction (in particular in the necessary condition - for the sufficient condition I get a contradiction following the steps of a direct proof).
So my problem is, can we actually prove it without using contradiction?
Moreover (and this is probably a very dumb question, so I apologize), is there a general way to know if a given result that we know is true can be proven only by contradiction or there exist a direct proof of it?
Looking forward to any feedback!
Suppose that $A\setminus B=B\setminus A$. Since $B\setminus A\subseteq B$, this implies that $A\setminus B\subseteq B$. But $(A\setminus B)\cap B=\varnothing$, so $A\setminus B=\varnothing$, and it follows immediately that $A\subseteq B$. Similarly, $B\subseteq A$, so $A=B$.
I suspect that you didn’t really use a proof by contradiction, however: more likely you found a proof of the contrapositive and dressed it up as a proof by contradiction. The contrapositive of this implication is that if $A\ne B$, then $A\setminus B\ne B\setminus A$. If $A\ne B$, then without loss of generality there is some $x\in A\setminus B$ that is not in $B\setminus A$. But then $x\in A$ and $x\notin B$, so $A\ne B$. If you began by assuming that $A=B$, this is a proof by contradiction, but that assumption is unnecessary: without it you have a direct proof of the contrapositive of the original implication.