This is valid in any characteristic (over an infinite field) and has nothing to do with completions, and is a "relative schematic density" result. It is a special case of EGA IV$_3$ 11.9.13, but it may not be immediately apparent why that is so. Hence, we give the entire proof of the affirmative answer below, going beyond the affine case to convey the geometric content (and because it is very useful beyond the affine case, to keep track of "fields of definition").

Let $k$ be an infinite field, and $K/k$ an arbitrary extension field. Let $X$ and $Y$ be arbitrary $k$-schemes with $X$ reduced and $Y$ separated. Assume a subset $\Sigma$ of $X(k)$ is Zariski-dense in $X$ (such as $\Sigma = X(k)$ with $X = \mathbf{A}^n_k$, or $\Sigma = X(k)$ with any generically smooth and reduced $X$ if $k$ is separably closed).

We claim that if a $K$-morphism $f:X_K \rightarrow Y_K$ carries $\Sigma$ into $Y(k)$ then $f$ descends to a $k$-morphism $f_0:X \rightarrow Y$ (such an $f_0$ being unique if it exists, by descent theory). The special case when $k = \overline{\mathbf{Q}}$, $K = \mathbf{C}$, and $\Sigma$ is a set of "special points" underlies considerations with fields of definition for Shimura varieties (and maps among them).

By fpqc descent theory, it suffices to show that the two pullback maps
$$p_1^{\ast}(f), p_2^{\ast}(f): X_{K \otimes_k K} \rightrightarrows Y_{K \otimes_k K}$$
over $K \otimes_k K$ coincide. The subsets $p_1^{-1}(\Sigma)$ and $p_2^{-1}(\Sigma)$ in $X(K \otimes_k K)$ coincide since
the two evident composite maps
$$k \rightarrow K \rightrightarrows K \otimes_k K$$
coincide. Let $\Sigma' \subset X(K \otimes_k K)$ denote this subset.

For any point $x' \in \Sigma'$, the maps
$(p_i)^{\ast}(f)$ carry $x'$ to the same point in $Y(K \otimes_k K)$.
Indeed, for each $i \in \{1, 2\}$ we have $x' = p_i^{\ast}(\sigma_K)$ for some common $\sigma \in \Sigma \subset X(k) \subset X(K)$ (depending on $x'$), and by hypothesis $f(\sigma_K) = y(\sigma)_K$ for some $y(\sigma) \in Y(k)$, so
$$((p_i)^{\ast}(f))(x') = p_i^{\ast}(f(\sigma_K)) = p_i^{\ast}(y(\sigma)_K) = y(\sigma)_{K \otimes_k K}$$
for both values of $i$.

We are now reduced to showing that if two maps $F_1, F_2: X_{K \otimes_k K} \rightrightarrows Y_{K \otimes_k K}$ over $K \otimes_k K$
coincide on the subset
$\Sigma'$ of $X(K \otimes_k K)$ then these maps agree. It is the same to show that if the restriction to any point in $\Sigma'$ of
the associated $K \otimes_k K$-map
$$F:X_{K \otimes_k K} \stackrel{(F_1,F_2)}{\longrightarrow}
Y_{K \otimes_k K} \times_{{\rm{Spec}}(K \otimes_k K)} Y_{K \otimes_k K} =
(Y \times_{{\rm{Spec}}(k)} Y)_{K \otimes_k K}$$
factors through the diagonal
$$\Delta_{Y_{K \otimes_k K}/K \otimes_k K} = (\Delta_{Y/k})_{K \otimes_k K}$$
then $F$ factors through that diagonal.

But recall that $Y$ is separated, so $\Delta_{Y/k}$ is a closed immersion. Hence, the $F$-preimage of the diagonal of $Y_{K \otimes_k K}$ is a closed subscheme of $X_{K \otimes_k K}$, and so our task is reduced to showing that if $Z$ is an arbitrary closed subscheme of $X_{K \otimes_k K}$ through which all points in $\Sigma'$ factor then $Z = X_{K \otimes_k K}$. Now $Y$ and $f$ have dropped out of the picture (e.g., the definition of $\Sigma'$ had nothing to do with $Y$ or $f$).

We may now *work Zariski-locally on $X$*, so finally $X$ is affine, say $X = {\rm{Spec}}(A)$ for a $k$-algebra $A$. Hence, $\Sigma$ is a collection of ideals $\{\mathfrak{m}_{\sigma}\}_{\sigma \in \Sigma}$ of $A$ for which $A/\mathfrak{m}_{\sigma} = k$ as $k$-algebras, and since $X$ is reduced the Zariski-density of $\Sigma$ in $X$ says exactly that

$$\bigcap_{\sigma \in \Sigma} \mathfrak{m}_{\sigma} = 0.$$
The closed subscheme $Z$ is defined by an ideal $J$ in $A_{K \otimes_k K}$, and we want to show $J=0$. By hypothesis any element $a' \in J$ vanishes under specialization at $K \otimes_k K$-points arising from $\Sigma$, which is to say $a' \in \mathfrak{m}_{\sigma} \otimes_k (K \otimes_k K)$ for all $\sigma \in \Sigma$.

Proving $J=0$ is therefore reduced to showing that
$$\bigcap_{\sigma \in \Sigma} (\mathfrak{m}_{\sigma} \otimes_k (K \otimes_k K)) \stackrel{?}{=} 0$$
inside $A \otimes_k (K \otimes_k K)$.

Finally, we are brought down to a problem entirely in linear algebra:
if $V$ and $W$ are arbitrary vector spaces over field $k$
(e.g., $V = A$, $W = K \otimes_k K$) and if $\{V_i\}$ is a collection of subspaces of $V$ such that $\cap_i V_i = 0$, then
$\cap_i (V_i \otimes_k W) = 0$ inside $V \otimes_k W$. This
has (a bit of) content since $W$ may be infinite-dimensional over $k$
and $\{V_i\}$ may be a collection of infinitely many subspaces.

Suppose to the contrary that there exists a nonzero
$\xi \in \cap_i (V_i \otimes_k W)$. By using a $k$-basis of $W$, we can pick a linear functional $\ell:W \rightarrow k$ such that ${\rm{id}}_V \otimes \ell: V \otimes_k W \rightarrow V$
does not kill $\xi$. But this map carries each $V_i \otimes_k W$ into $V_i$, so it carries $\xi$ into $\cap_i V_i$. This contradicts the hypothesis that $\cap_i V_i = 0$.

QED