4. Given the equation about $x$
$$
\lg k x=2 \lg (x+1)
$$

has only one real solution. Then the range of the real number $k$ is
4. $(-\infty, 0) \cup\{4\}$.

Notice that,
$$
\lg k x=2 \lg (x+1) \Leftrightarrow\left\{\begin{array}{l}
x>-1, \\
k x=(x+1)^{2} .
\end{array}\right.
$$

From the graph, we know that when $k-1)$ there is only one common point; when $k>0$, the line $y=k x$ and the curve $y=(x+1)^{2}$ $(x>-1)$ have only one common point if and only if the line $y=k x$ is tangent to the parabolic arc $y=(x+1)^{2}(x>-1)$.
At this time, $k=4$.
In summary, the range of values for $k$ is $(-\infty, 0) \cup\{4\}$.