We prove the second inclusion by the contrapositive. Let $R=k[x_{1},\dots,x_{n}]$ where $k$ is algebraically closed, $B$ and ideal in $R$, and $f \notin \sqrt{B}$. As $\sqrt{B}$ is equal to the intersection of prime ideals in $R$ containing $B$, choose some prime $\mathfrak{p}$ such that $f \notin \mathfrak{p}$. Then consider the sequence of maps
$$R \rightarrow R/\mathfrak{p} \rightarrow \left(R/\mathfrak{p} \right)_{1/{\overline{f}}} $$
where $\overline{f}$ is the image of $f$ in $R/\mathfrak{p}$. Note that this is nonzero. Let $S=\left(R/\mathfrak{p} \right)_{1/{\overline{f}}}$. As $R$ is a finitely-generated $k$-algebra, so is $S$, hence so is $S/\mathfrak{m}$ where $\mathfrak{m}$ is a maximal ideal in $S$. As $S/\mathfrak{m}$ is a field, it is a finite extension of $k$, but $k$ is algebraically closed, so $S/\mathfrak{m} \simeq k$.
First, notice that the images of the $x_{i}$ under the map $R \rightarrow S/\mathfrak{m} \simeq k$ correspond to elements $a_{i} \in k$, so that $a=(a_{1},\dots,a_{n}) \in \mathbb{A}^{n}$. Second, note that if we take the image of some polynomial $h(x_{1},\dots,x_{n})$ under this map, this image is nothing more than the value of $h$ at the point $(a_{1},\dots,a_{n})$.
$\textbf{Claim:}$ The point $a$ lies in $V(B)$ and $f(a) \ne 0$.
To see this, let $g \in B$. This means that $g \in \mathfrak{p}$, so $g$ is zero in the quotient, hence zero in the map $R \rightarrow S/\mathfrak{m} \simeq k$. Thus, for all $g \in B$, $g(a)=0$. Now note that $\overline{f}$ is a unit in the ring $S$, as we've localized. This means that $\overline{f} \notin \mathfrak{m}$, so that the image of $f$ in $k$ is not equal to zero. Thus, $f \notin I(V(B))$.
The first inclusion you wrote down can be proved as a simple consequence of the second inclusion.
Edit: Let $k$ be algebraically closed. As an affine variety in $\mathbb{A}^{n}$ is defined by $V(\mathfrak{a})$ where $\mathfrak{a} \subseteq k[x_{1},\dots, x_{n}]$ is an ideal, we reduce the problem, by the Nullstellensatz, to proving that $V(\sqrt{\mathfrak{a}})=V(\mathfrak{a})$. This reduction follows because if $X=V(\mathfrak{a})$ is an affine variety, then $V(I(X))=V(\sqrt{\mathfrak{a}})$. If $p \in V(\sqrt{\mathfrak{a}})$ then $f^{r}(p)=0$ for all $f^{r} \in \sqrt{\mathfrak{a}}$. However, $f^{1}=f \in \mathfrak{a}$, so all functions in $\mathfrak{a}$ vanish at $p$. Conversely, if $f(p)=0$ for all $f \in \mathfrak{a}$, then for all $g \in \sqrt{\mathfrak{a}}$, there exists $r>0$ such that $g^{r}$ vanishes at $p$. However, as $k$ is a field and $g^{r}(p)=g(p)\cdots g(p)$, we have $g(p)=0$. Thus, $V(\sqrt{\mathfrak{a}})=V(\mathfrak{a})$.