Set of $v$ such that $v \in W $ and $Av \in W $ Let A be an $n\times n$ matrix of rank $n$, and $W$ a non-trivial subspace of $\mathbb R^n$.
What is the set of vectors $v$ such that $v \in W $ and $Av \in W $?
Is this a simple problem?
 A: This is not a particularly simple problem and I will not go into great detail. For a good introduction to the subject, I suggest you take a look at Chapter 2 of this book. I will call the set of vectors satisfying your condition $S$.
Basically, you are after the maximal $A$-invariant subspace in $W$. Let $V$ denote the maximally $A$-invariant subspace of $W$. 
Let $U\subseteq W$ be any $A$-invariant subspace in $W$. Then clearly for each $\mathbf{v}\in U \subseteq W$ we have $A\mathbf{v} \in U\subseteq W$. Therefore the set $S$ you are after contains every $A$-invariant subspace of $W$ and specifically it contains the maximal such subspace, $V\subseteq S$.
Conversely, suppose that $V$ is the maximal $A$-invariant subspace of $W$ (the fact that such a subspace exists and is unique we take for granted, although it is proven in the book). Suppose there is some vector $\mathbf{v}$ such that $\mathbf{v}\in S$ but $\mathbf{v}\notin V$. Then $\langle \mathbf{v}\rangle$ is a one-dimensional $A$-invariant subspace of $W$ independent from $V$. Therefore $V\oplus \langle\mathbf{v}\rangle$ is a $A$-invariant subspace which properly contains $V$, contrary to the fact that $V$ is maximal. This is a contradiction. Therefore $S\subseteq V$. 
Now let $B$ be an operator $B:\mathbb{R}^n\rightarrow \mathbb{R}^n$ such that $\ker(B)=W$. Then the maximally $A$-invariant subspace of $W$ is given by
$$V=\bigcap^{n-1}_{k=0} \ker(BA^k)$$
Again, I direct you towards the book linked above for a proof of this statement.
A: Maybe one computational approach to this problem is to come up with an orthonormal basis $w_1, ..., w_k, v_{k+1}, ..., v_n$ where the $w_i$ are an orthonormal basis for $W$ and the remaining vectors are an orthonormal basis for $W^\perp$. Then your problem reduces to solving the system of equations:
$\sum_{i=1}^k a_i v_j^T A w_i = 0$
For $j = 1, ..., (n-k)$. There are $k$ coefficients $a_i$, and there are $(n-k)$ equations, so basically it comes down to finding the null-space of some $(n-k) \times k$ matrix. One efficient way to compute a null-space is with SVD. It can also be done with QR decomposition, or even just with row-reduction.
Once you have a basis for the null-space of the matrix $(v_j^T A w_i)$, these vectors become coefficients for vectors of the form $\sum a_i w_i$ which themselves form a basis for the vector subspace $W \cap A^{-1}(W)$.
