Let $I$, $J$ are ideals of a commutative ring $R$, $S$ a multiplicative subset of $R$. I want to show that $S^{-1}(I \cap J)=S^{-1}I \cap S^{-1}J$.
This is my attempt:
⊆ : A typical element of $S^{-1}(I \cap J)$ is of the form $s^{-1}k$, where $s \in S$, $k \in I \cap J$. Then $k \in I$ and $k \in J$, so $s^{-1}k \in S^{-1}I$ and $s^{-1}k \in S^{-1}J$. Therefore $s^{-1}k \in S^{-1}I \cap S^{-1}J$.
⊇ : If $s^{-1}k \in S^{-1}I \cap S^{-1}J$, then $s^{-1}k\in S^{-1}I$ and $s^{-1}k\in S^{-1}J$. Therefore $k\in I$ and $k \in J$, so $k \in I \cap J$. Then $s^{-1}k \in S^{-1}(I \cap J)$.
Is it correct?
$\subseteq$ is obvious.
Your approach for $\supseteq$ is wrong since it assumes that the same elements are the 'components' of both.
$\supseteq$ Let's say $c \in S^{-1}I \cap S^{-1}J$.
Then since $c \in S^{-1}I$ then there is $s \in S, a \in I$ such that $c = s^{-1}a$.
Similarly there is $t \in S,b \in J$ such that $c = t^{-1}b$.
What we need to show that there is some $d \in I \cap J$ and $u \in S$ such that $c = u^{-1}d$ as well.
Now, $c = s^{-1}a = t^{-1}b$ which means that $ts^{-1}a = b \in J$. Since $a \in I$ and $I$ is an ideal, this means that $ts^{-1}a = b \in I$ and so $b \in I \cap J$. From there we find that $t^{-1}b = c\in S^{-1}(I \cap J)$ as desired.
We can do the same thing by showing $a \in J$ as well of course.