prove that $f(\bigcap^n_i X_i) \subset\bigcap^n_if(X_i) $ If $f:A \to B$ and $\{X_i\}^n_i$ is a collection of subsets of $A$, how to prove that
 $$f\left(\bigcap^n_i X_i\right) \subset\bigcap^n_if(X_i) $$ 
I have a basic understanding of why it is true, but I don't understand how to write the proof formally.
 A: Let $y \in f(\bigcap X_i)$. This means that there is some $x \in \bigcap X_i$ such that $f(x)=y$. Since $x \in \bigcap X_i$, $x \in X_i$ for all $i$. So $y \in f(X_i)$ for all $X_i$, so $y \in \bigcap f(X_i)$. Therefore, $f(\bigcap X_i) \subset \bigcap f(X_i)$. 
A: Suppose that $b\in f\left(\bigcap X_i\right)$. By the definition of the image of a set under a function, there exists some $a\in A$ such that $a\in\bigcap X_i$ and $b=f(a)$. But then $a\in X_i$ for all $i$, so that $b=f(a)\in f(X_i)$. Since this is true for all $i$, it follows that $b\in \bigcap f(X_i)$.
Conclusion: any element of $ f\left(\bigcap X_i\right)$ is also an element of $\bigcap f(X_i)$, so that $ f\left(\bigcap X_i\right)\subseteq \bigcap f(X_i)$.

The inclusion can be strict. To see this, let $A=B=\mathbb R$, and $f(a)=a^2$ for all $a\in\mathbb R$. Let $X_1=(0,\infty)$ and $X_2=(-\infty,0)$. Then, $f(X_1)=f(X_2)=(0,\infty)$, so that $f(X_1)\cap f(X_2)=(0,\infty)$. On the other hand, $X_1\cap X_2=\varnothing$, so that $f(X_1\cap X_2)=\varnothing$. In this particular case, $f(X_1\cap X_2)$ is a proper subset of $f(X_1)\cap f(X_2)$.

However, the inclusion goes both ways if $f$ is injective. To see this, suppose that $f$ is injective and take any $b\in \bigcap f(X_i)$. Then, $b\in f(X_i)$ for each $i$, so that there exists for each $i$ some $a_i\in X_i$ such that $b=f(a_i)$. But $f$ is injective, so that actually all of the $a_i$’s must be one and the same—denote it as $a$. By the foregoing, $a\in X_i$ for all $i$, so that $a\in\bigcap X_i$. Therefore, $b=f(a)\in f\left(\bigcap X_i\right)$.

Note that the number of $X_i$’s involved in the intersections need not be finite. The proofs go through even if the index set over which intersections are taken contains infinitely (countably or uncountably) many elements.
