Is the Lagrangian density a functional or a function?
The Lagrangian density is a function.
Consider the following examples: $$ A[f]=\int_0^1\mathrm dx\ f(x) $$ and $$ B(f(x))=f(x) $$
It is clear that $A$ is a functional, because for example $$ A[\sin]=1-\cos1=0.45\in\mathbb R $$ is a number, while $B$ is a function, because $$ B(\sin)=\sin $$ is not a number, but a function.
In your notation, $L$ is a functional, because given a certain field configuration, you get a number. But $\mathscr L$ is a function, because given a certain field configuration, you get another function, not a number.
In some cases, such as QED in the Coulomb gauge, you may want to include non-local terms in the Lagrangian density, which makes it into a function of some of its arguments, and a functional of the others. This is an exception to the rule above.
Within the framework of differential geometry, the construction goes as follows. Let there be given a 4-dimensional orientable spacetime manifold $M$. A field is a section $$\phi~\in~\Gamma(E) \tag{1}$$ in a bundle $(E,\pi,M)$.
The Lagrangian$^1$ 4-form $\mathbb{L}$ is a bundle map $$ \begin{array}{rcl} J^1(M,E) &\stackrel{\mathbb{L}}{\longrightarrow}& \bigwedge^4T^{\ast}M \cr \searrow && \swarrow \cr &M&\end{array}\tag{2}$$ from the first$^2$ jet bundle $J^1(M,E)$ to the canonical bundle over $M$.
In a local coordinates chart $U\subseteq M$, the Lagrangian 4-form is $$\left. \mathbb{L}\right|_U~=~{\cal L} ~\mathrm{d}^4x, \qquad \mathrm{d}^4x ~:=~\mathrm{d}x^0\wedge\mathrm{d}x^1\wedge\mathrm{d}x^2\wedge\mathrm{d}x^3, \tag{3}$$ where ${\cal L}$ is the Lagrangian density. In other words, the Lagrangian density ${\cal L}$ transforms$^3$ as a density under general coordinate transformations of spacetime $M$.
The action functional $S:\Gamma(E)\to \mathbb{R}$ is defined as $$S[\phi]~:=~\int_{M} (j^1\phi)^{\ast} \mathbb{L}.\tag{4}$$ See also e.g. this and this Phys.SE posts.
Let us for simplicity assume that $M$ has a globally defined coordinate system $U\subseteq \mathbb{R}^4$, and only use this from now on.
Moreover, let us for simplicity assume that $\phi$ is a real scalar field. Then the total space is $E= M\times\mathbb{R}$, and the bundle $(E,\pi,M)$ is a trivial line bundle.
Then the first jetbundle $$J^1(M,E)~\cong~ T^{\ast}M \times \mathbb{R}\tag{5}$$ has $4+1+4=9$ coordinates $$(x^0,x^1,x^2,x^3;~ u;~ u_0, u_1, u_2, u_3).\tag{6}$$ In particular, the Lagrangian density $${\cal L}: U \times \mathbb{R}^5~\longrightarrow ~\mathbb{R} \tag{7}$$ is a (density-valued) function, cf. OP's title question.
Be aware that physicists often use the same notation for the Lagrangian density ${\cal L}$ and the pull-back $(j^1\phi)^{\ast} {\cal L}$, i.e. they often write $${\cal L}(x^0,x^1,x^2,x^3;~ u;~ u_0, u_1, u_2, u_3) \tag{8} $$ as $${\cal L}\left(x^0,x^1,x^2,x^3;~ \phi(x);~ \partial_0\phi(x), \partial_1\phi(x), \partial_2\phi(x), \partial_3\phi(x)\right). \tag{9} $$
--
$^1$ The Lagrangian 4-form $\mathbb{L}$ and the Lagrangian density ${\cal L}$ should not be confused with the Lagrangian $L$. More generally, the Lagrangian $L$ is a function (and equal to the Lagrangian density ${\cal L}$) in point mechanics; while the Lagrangian $L$ is a functional in field theory. See also this Phys.SE post.
$^2$ There is a straightforward generalization to higher-order Lagrangian systems in an (possibly non-orientable) spacetime $M$ of arbitrary dimension.
$^3$ Here we are being a bit cavalier about whether the Jacobian transformation law for a density should include an absolute value or not. This is not an issue if the spacetime $M$ is orientable.
In general, a functional is a map $V \to F$ for a vector space $V$ over a field $F$. Such functionals live in the dual space $V^*$ if they are linear.
$V$ can be infinite-dimensional and if it is some space of functions, then a functional is a map of a function to some scalar. For example,
$$\mathcal{E}[f] = \int_0^1 f(x)^2 \, dx$$
is an example of a functional mapping $f(x) \mapsto \int_0^1 f(x)^2 \, dx.$ This is not the same as function composition, $f \circ g = f(g(x))$ which simply produces another function. Now, the Lagrangian density of the form, $\mathcal L (\phi, \partial_\mu \phi)$ takes some function $\phi$ and its derivatives, and produces a function. We could replace the notation with dummy variables and then use composition to write this operation equivalently.
On the other hand, the Lagrangian rather than Lagrangian density,
$$L = \int d^3 x \, \mathcal L (\phi, \partial_\mu \phi)$$
is a functional but providing you think of $t$ as being held fixed.