[guided]We first recall the closed-set characterisation of the subspace topology. A set $C \subset A$ is closed in $A$ if and only if $A \setminus C$ is open in $A$, which holds if and only if $A \setminus C = U \cap A$ for some open $U \in \tau$. Taking complements relative to $A$: $C = A \setminus (U \cap A) = A \cap (X \setminus U)$. Setting $F = X \setminus U$, which is closed in $X$, we obtain $C = F \cap A$. Conversely, if $C = F \cap A$ for some closed $F$ in $X$, then $A \setminus C = A \cap (X \setminus F)$ is the intersection of $A$ with the open set $X \setminus F$, hence open in $A$, so $C$ is closed in $A$.
Applying this to $B$: since $B$ is closed in $A$, there exists a closed set $F \subset X$ with $B = F \cap A$. Now $A$ is closed in $X$ by hypothesis, and $F$ is closed in $X$ by construction. Since finite intersections of closed sets are closed (the complement of $F \cap A$ is $(X \setminus F) \cup (X \setminus A)$, a union of two open sets, hence open), $B = F \cap A$ is closed in $X$.
As in part 1, both hypotheses are necessary. Without $A$ being closed in $X$, the intersection $F \cap A$ of a closed set with a non-closed set need not be closed. For example, $\{0\}$ is closed in $A = [0, 1)$ (as a subspace of $\mathbb{R}$), but $[0, 1)$ is not closed in $\mathbb{R}$; nonetheless $\{0\}$ is still closed in $\mathbb{R}$ in this case. A sharper example: $A = (0, 1)$ is not closed in $\mathbb{R}$, the set $B = (0, 1)$ is closed in $A$ (it equals $A$ itself), yet $B = (0, 1)$ is not closed in $\mathbb{R}$.[/guided]