Is a definition like $ g(f(x)) = 0 $ possible? Is it (in any way) possible to define function $g$ like this?

$$ f(x) = x $$
$$ g(f(x)) = 0  $$

Why?
Better write,

$$g:\mathbb R\to\mathbb R:g(x)=0$$

or

$$g=\{x\in\mathbb R:(x,0)\}.$$

$f$ plays no role.



More generally,

$$g:\text{range}(f)\to\mathbb R:g(x)=0$$

or

$$g=\{x\in\text{range}(f):(x,0)\}.$$
Better write,

$$g:\mathbb R\to\mathbb R:g(x)=0$$

or

$$g=\{x\in\mathbb R:(x,0)\}.$$

$f$ plays no role.



More generally,

$$g:\text{range}(f)\to\mathbb R:g(x)=0$$

or

$$g=\{x\in\text{range}(f):(x,0)\}.$$