here is my proof but it only works for functions that have an inverse:

here is my proof but it only works for functions that have an inverse:

I can prove it by showing that all elements from $f(A1) - f(A2)$ belong to $f(A1 - A2)$. (Let me use the symbol $-$ for the exclusion of sets.)
Let's consider a $y \in f(A1) - f(A2)$. This implies two consequences:
Since $f(x) = y \not= f(x')$, we derive that $x \not= x'$ for any $x' \in A_2$. Therefore, $x \not\in A_2$.
In conclusion, $\exists x \in A1 - A2 \text{ s.t. } f(x) = y$, so $y \in f(A1 - A2)$.
Or $f(A_1)\setminus f(A_2)\subset f(A_1\setminus A_2)\Leftrightarrow f(A_1)\subset f(A_1\setminus A_2)\cup f(A_2)=f((A_1\setminus A_2)\cup A_2)=f((A_1\cup A_2)\cap (A_2^{c} \cup A_2))=f(A_1\cup A_2)$ and $A_1\subset A_1\cup A_2$
Claim $(\forall x)(x \in f(A1) \setminus f(A2) => x \in f(A1\setminus A2)$.
Let $x \in f(A1) \setminus f(A2)$.
$\Rightarrow x \in f(A1)\land x \notin f(A2) $
$\Rightarrow (\exists y \in A1) f(y) = x \land (\not \exists z \in A2) f(z) = x $
$\Rightarrow (\exists y \in A1) f(y) = x \land ( \forall z \in A2) f(z) \neq x $
$ \Rightarrow (\forall z \in A2) (\exists y \in A1) f(y) = x \land{} f(z) \neq x $
$f$ a function $ \Rightarrow (\forall z \in A2) (\exists y \in A1) f(y) = x \land f(z) \neq x \land z \neq y $
$ \Rightarrow (\forall z \in A2) (\exists y \in A1) f(y) = x \land f(z) \neq x \land (\forall z \in A2) z \neq y $
$ \Rightarrow (\exists y \in A1) f(y) = x \land y \notin A2 $
$ \Rightarrow (\exists y) y \in A1 \land y \notin A2 \land f(y) = x $
$ \Rightarrow (\exists y \in A1 \setminus A2) f(y) = x $
$ \Rightarrow x \in f(A1 \setminus A2) $