Non-algebraic set of countably infinite set of points Algebraic subsets of affine space have the property $(*)$: that their intersection with a line $L$ is either finite or $L$ itself (so $L$ was a subset). I am building an example of a set with property $(*)$, but is not algebraic. I am allowed to use any field and any dimension to construct this counterexample. My original idea was to simply take the graph of $e^x$ in $\mathbb{R}^2$, or $\mathbb{A}_{\mathbb{R}}^2$ if you prefer. I think this graph clearly has the property. I had trouble showing that it wasn't an algebraic set. So, instead of forcing that route, I build a set that I imagine won't be algebraic out of points instead of arcs. The construction is as follows: Pick any two distinct points at least distance one from eachother in the plane. Pick another point by avoiding all lines connecting the previous points, and choose this point to be at least distance one from the other points. We can build a countable collection of isolated points in this way, call it $X$. 
If $X$ doesn't intersect a line $L$, great. If it does in exactly one point, great. Suppose $L$ intersects $X$ in at least two points $x_i$ and $x_j$, and suppose $i<j$. In the construction of $X$, $x_j$ does not sit on a line which connects any two points of smaller index. Since $x_i$ is one point with smaller index, there can be no other points index less than $j$ on $L$. But each point after $x_j$ avoids the line containing $x_j$ and $x_i$. So $|L\cap X|=2$, and $X$ has property $(*)$.
Now I need to show that $X$ is not algebraic. My hope was that working with isolated singletons would make proving this more simple, but now I realize that there is more subtlety here than I originally thought. In any case, by way of contradiction, suppose $X$ is algebraic. Then $X$ decomposes uniquely as a non-trivial union of irreducible algebraic sets $X=U_1\cup,\dots,\cup U_n$. But each isolated point $X_i=\lbrace x_i\rbrace$ is algebraic and irreducible. Thus $X_i\subset X$ implies that each $X_i$ is a subset of some irreducible $U_j$. By countable pigeonhole, without loss of generality, suppose that $U_1$ contains countably infinitely many of our $x_i$'s. Now $U_1$ is an irreducible countably infinite set having property $(*)$. This at least tells us that $I(U_i)$ is a prime ideal. 
Remark: I don't know if we need to take the $x_i$'s to be at least distance from one another, but I figured we should.
 A: I think your original idea of using the graph of $e^x$ is a good one. Here's how I'd finish the proof of that statement:
Lemma: No polynomial vanishes on all points of the form $(x,e^x)$.
Proof: Plug in and take limits as $x\to\infty$. You'll have a sum of polynomials times exponential functions, and so by factoring out the maximal power of $e^x$, you can see that $0=e^{-x}(\cdots)+p(x)$ where $p(x)\neq 0$. Taking the limit as $x\to \infty$, we see that $p(x)$ must have limit $0$ at $\infty$, which is clearly nonsense.
This means that any algebraic curve in the plane can only intersect the exponential function in finitely many points. In particular, any line may intersect it at most twice.
An alternative proof is that any infinite discrete set in an affine space is not algebraic. It suffices to show this in $\Bbb A^1$, as we can reduce to this by projecting suitably. But we already know that $\Bbb A^1$ has the cofinite topology, so the claim is proven and you may wish to use this in your attempt by choosing individual points.
