Real, non-constant scalar field with special properties in class of 4-dimensional spacetimes David Deutsch (Oxford University) asked the following question which I think is an interesting one:
In what class of 4-dimensional spacetimes does there exist a real, non-constant scalar field φ with the following properties:


*

*It obeys the wave equation: ◻φ=0

*Its gradient is everywhere null:
∇φ.∇φ=0


Deutsch would "like the answer to be 'almost none'" but I am really not sure...
 A: There are many such spacetimes. Already the Minkowski space, $g_{\mu\nu}={\rm const}$, has a non-constant solution $\varphi$ (in either interpretation 1 or interpretation 2 of the question(v1), cf. Muphrid's comment). The wave eq. in a curved spacetime reads
$$\sum_{\mu,\nu=0}^3\partial_{\mu}\sqrt{-g}g^{\mu\nu}\partial_{\nu}\varphi~=~0.$$ 


*

*If e.g. the metric $g_{\mu\nu}$ is of the form
$$
 g_{\mu\nu}~=~\left[ \begin{array}{cc} -1 & 0 \\ 0 &g_{ij}(x^1,x^2,x^3) \end{array} \right], \qquad \mu,\nu=0,1,2,3,\qquad i,j=1,2,3,
$$
and 
$$ \sum_{i,j=1}^3(\partial_{i}\varphi)g^{ij}(\partial_{j}\varphi)~=~0,  $$
then we can pick an affine function in time
$$\varphi(x)~=~ ax^0+b, $$
as Nick Kidman suggests in a comment.

*If e.g. the metric $g_{\mu\nu}$ is on light-cone form
$$
 g_{\mu\nu}~=~\left[ \begin{array}{cc} 0 & -1 & 0 \\-1 & 0 & 0 \\ 0 & 0 &g_{ij}(x^2,x^3) \end{array} \right],  \qquad \mu,\nu=+,-,2,3,\qquad i,j=2,3,
$$
and 
$$ \sum_{\mu,\nu}(\partial_{\mu}\varphi)g^{\mu\nu}(\partial_{\nu}\varphi)~=~0,  $$
then we can e.g. pick an arbitrary function 
$$\varphi(x)~=~ f(x^+), $$
where we have used light-cone coordinates $x^{\pm}=\frac{1}{\sqrt{2}}(x^0\pm x^1)$.
NB: It is possible that David Deutsch's claim in simplified terms essentially boils down to the following.  Put some measure $\mu$ on the space ${\cal M}$ of all metrics $g_{\mu\nu}$ on, say, spacetime $\mathbb{R}^4$, and consider the subset ${\cal N}\subseteq{\cal M}$ of metrics $g_{\mu\nu}$ that admit a non-constant solution for $\varphi$.  David Deutsch's phrase almost none  should then be understood as that the subset ${\cal N}$ has measure zero, $\mu({\cal N})=0$. If OP's actual question is whether $\mu({\cal N})$ is zero or not in that sense, then my above answer is insufficient.
A: Raychaudhuri.
Let $V_\mu \equiv \partial _\mu \phi$. null foliation.
null condition: $V^\mu V_\mu =0$.
exterior derivative: $\partial_\mu V_\nu = \partial_\nu V_\mu$, i.e. zero vorticity.
$\square \phi=0$ means zero expansion $\hat\theta =V^\mu{}_{;\mu}=0$.
gradient of null condition: $V^\mu V_{\mu;\nu}=0$
contract exterior derivative: $V^\mu V_{\mu;\nu}=V^\mu V_{\nu;\mu}=(\nabla_{\bf V} {\bf V})_\nu=0$, i.e. zero acceleration, i.e. null geodesics.
Raychaudhuri's null equation when the expansion and vorticity are zero:
$2\hat\sigma^2 +T_{\mu\nu}V^\mu V^\nu =0$.
assume $\phi$ is real. then, $\bf V$ is also real and $\hat\sigma^2$ is nonnegative.
Assume there exists a point x where the null energy is always positive for all null directions. Then, no solution exists. This remark doesn't apply for complex $\phi$.
If there's no such point, but if there exists a point x such that for all null geodesics passing through it with nonpositive null energy at x, there always exists another point y on the null geodesic such that the null energy is positive along it there, no solution exists either.
Consider the subclass of Ricci flat metrics. Then, reality means the shear has to be zero everywhere. This means $\bf V$ describes a null Killing vector field. In general, none exist.
