Logged In: YES

Maxima actually should be able to do this one if you declare
any one of f, g, or x to be nonscalar:

map(nonscalarp, [ a, f(a), a(1), a(x), f(a(x)) ] ) => all true

Diff could perfectly well check nonscalarp; so this is a bug in

Note that nonscalarp assumes by default that functions of
nonscalars are nonscalar. If you want a scalar function of a
non-scalar, you need to explicitly declare it:

nonscalarp(f(ns)) => true
nonscalarp(s(ns)) => false

By the way, Maxima has no way of distinguishing the variable
a from the function a.

I am not sure what the right way to handle transpose is.