Let $P(X,\mathcal F)$ denote the property: For every function $f\colon X\times \mathbb R\to\mathbb R$,
if $f(x,h(x))$ is continuous
for every $h\colon X\to\mathbb R$ from $\mathcal F$,
then $f$ is continuous.
We investigate the assumptions of a theorem of Luzin, which states that
$P(\mathbb R,\mathcal F)$ holds for $X=\mathbb R$ and $\mathcal F$
being the class $C(X)$ of all continuous functions from $X$ to $\mathbb R$.
The question for which topological spaces $P(X,C(X))$ holds was
investigated by Dalbec.
Here, we examine $P(\mathbb R^n,\mathcal F)$ for different families $\mathcal F$.
In particular, we notice that $P(\mathbb R^n,``C^1\mbox{''})$ holds, where “$C^1$”
is the family of all functions in $C(\mathbb R^n)$ having
continuous directional derivatives allowing infinite values;
and this result is the best possible, since $P(\mathbb R^n,D^1)$
is false, where $D^1$
is the family of all differentiable functions (no infinite derivatives allowed). We notice that if $\mathcal D$ is the family of the graphs of functions
from $\mathcal F\subseteq C(X)$, then
$P(X,\mathcal F)$ is equivalent to the property $P^*(X,\mathcal D)$:
For every $f\colon X\times \mathbb R\to\mathbb R$,
if $f\upharpoonright D$ is continuous
for every $D\in\mathcal D$, then $f$ is continuous.
Note that if $\mathcal D$ is the family of all lines in
$\mathbb R^n$, then, for $n\geq 2$, $P^*(\mathbb R^n,\mathcal D)$ is false,
since there are discontinuous linearly continuous functions on $\mathbb R^n$.
In this direction, we prove that
there exists a Baire class 1 function $h\colon \mathbb R^n\to\mathbb R$
such that $P^*(\mathbb R^n,T(h))$ holds,
where $T(H)$ stands for all possible translations of
$H\subset \mathbb R^n\times\mathbb R$;
and this result is the best possible, since $P^*(\mathbb R^n,T(h))$
is false for any $h\in C(\mathbb R^n)$.
We also notice that $P^*(\mathbb R^n,T(Z))$ holds for any Borel
$Z\subseteq\mathbb R^n\times\mathbb R$ either of positive measure or of second category.
Finally, we give an example of a perfect nowhere dense
$Z\subseteq\mathbb R^n\times\mathbb R$ of measure zero for which
$P^*(\mathbb R^n,T(Z))$ holds.