Given $x\in \mathbb{R}^n$, Is there exist a matrix $A\in \mathbb{R}^{n\times n}$ such that $A$ only have $x$ as the null space? Given $x\in \mathbb{R}^n,x\ne 0$, Is there exist a matrix $A\in \mathbb{R}^{n\times n}$ such that $A$ has the null space that only expanded by $x$. Namely,
$$Ax=0$$
$$Ay\ne 0, (y\ne cx)$$
Intuitively, matrix $A$ exists, but how can we construct it? I think this problem contains two parts. First, we should prove that $A$ exists. Then we should show how to construct the matrix $A$.
 A: If $x = 0$, it suffices to take an invertible matrix $A$ (such as the identity matrix). So, I will consider only the case where $x \neq 0$.
One convenient way to construct a suitable matrix is to use an orthogonal projection matrix. In particular, given the non-zero vector $x$ of interest, take
$$
A = I - \frac{xx^T}{x^Tx},
$$
where $I$ is the identity matrix. Note that for a vector $y$, $Ay$ is the component of $y$ orthogonal to $x$. So, $Ay = 0 \iff y = cx$ for some $c \in \Bbb R$.
For a more rigorous argument that doesn't rely on an understanding of orthogonality, consider the following.
\begin{align}
Ay = 0 &\implies \left(I - \frac{xx^T}{x^Tx} \right)y = 0
\\ &\implies y - \frac{x(x^Ty)}{x^Tx} = 0
 \implies y = \frac{x^Ty}{x^Tx} \cdot x.
\end{align}
so, if $Ay = 0$, then $y = cx$ with $c = \frac{x^Ty}{x^Tx}$. Conversely, if $y = cx$, then
$$
Ay = cx - \frac{x(x^T(cx))}{x^Tx} = cx - c\cdot \frac{x^Tx}{x^Tx} \cdot x = 0.
$$
A: For $x=0$ just take the identity matrix.
For $x\neq 0$ take the vector $x$ and make it part of a basis $\mathcal{B}=\{x,v_2,…,v_n\}$. Take the matrix $$B=\begin{bmatrix}0&0\\0&I_{n-1}\end{bmatrix}$$, which sends $x$ to 0 and all $v_i$ to themselves. Then
$$A=D_\mathcal{SB}BD_\mathcal{BS}$$
does the job, where $\mathcal{S}=\{e_1,…,e_n\}$ denotes the standard basis and $D_\mathcal{BS}$ is the change of coordinate matrix from standard basis to the chosen basis $\mathcal{B}$.
A: Yes. One way to generate such an A is as follows:
Take the first column of an $n\times n$-matrix $T$ to be $x$ and choose arbitrary $n-1$ other vectors for the remaining columns such that they form a basis of $\mathbb{R}^n$ - e.g. they can be chosen as $n-1$ vectors from the $n$ standard basis vectors $e_i$. Let $D$ be a diagonal matrix with only $1$ in the diagonal except for $D_{1,1}=0$. Then $A=TDT^{-1}$ will do or even just $A=DT^{-1}$.
A: Assume $x\in\Bbb{R^n}\setminus \{0\}$ ( otherwise it's trivial)
Let $x=(x_1, x_2, \ldots, x_n) $ and suppose $x_i\neq 0$ for some $1\le i\le n$
Then consider the matrix $A\in M_n(\Bbb{R})$ such that
$\operatorname{rref}A =\begin{pmatrix} e_1,\ldots,e_{i-1},-N_i,e_{i+1},\ldots,e_n\end{pmatrix}$
Where $e_i$ is the $i$-th column vector of identity matrix and
$N_i=\begin{pmatrix}\frac{x_1}{x_i}\\ \vdots\\ \frac{x_{i-1}}{x_i}\\0\\\frac{x_{i+1}}{x_i}\\\vdots\\ \frac{x_n}{x_i}\end{pmatrix}$
Null space basis is $\{\begin{pmatrix}\frac{x_1}{x_i}\\ \vdots\\ \frac{x_{i-1}}{x_i}\\1\\\frac{x_{i+1}}{x_i}\\\vdots\\ \frac{x_n}{x_i}\end{pmatrix}\}$
Then it is clear that $Ax=0$ as $x$ is $x_i$ times basis vector and $\operatorname{rref}A$ has exactly $n-1$ pivot columns .Null space is $1$-dimensional and $0\neq x\in \operatorname{null}(A) $ . Isn't it enough to conclude $\operatorname{null}(A)= \textrm{span}\{x\}$ ?
Hence $\operatorname{null}(A) =\textrm{span}\{x\}$

Note: Choose the matrix  $\operatorname{rref}A$ or any matrix whose reduced row echelon form is of the above form to get a one dimensional null space form by a specific vector.

Example $1$:
Let $n=2 $ and we want a matrix whose null space is spanned by $\begin{pmatrix}1\\2\end{pmatrix}$
Then choose $A$ such that $\operatorname{rref}A=\begin{pmatrix}1&\frac{-1}{2}\\0&0\end{pmatrix}$
Then null space basis is $\{\begin{pmatrix}\frac{1}{2}\\1\end{pmatrix}\}$
Then null space is also spanned by $\{2\begin{pmatrix}\frac{1}{2}\\1\end{pmatrix}\}$

Example $2$: Find a $3×3$ matrix whose null space is spanned by $\{\begin{pmatrix}0\\1\\5\end{pmatrix}\}$.
Answer: $N_3=\begin{pmatrix}0\\\frac{1}{5}\\1\end{pmatrix}$
Then $A=\{\begin{pmatrix}1&0&0\\0&1&\frac{-1}{5}\\0&0&0\end{pmatrix}\}$
$\begin{align}\operatorname{null}(A) &=\textrm{span}\{  \begin{pmatrix}0\\\frac{1}{5}\\1\end{pmatrix} \}\\&=\textrm{span}\{  \begin{pmatrix}0\\1\\5\end{pmatrix} \}\end{align}$
