1 Introduction

Functional equations play a significant role in various algebraic problems. In particular composite type equations have several nontrivial applications in determining the substructures of algebraic structures. More details concerning such applications can be found in [14, 7, 912] and [1419]. Let us recall one of the problems considered in [9]. Assume that \((E,\cdot )\) is a semigroup with unit element, \((F,+)\) is a group and \((E,\cdot )\) acts on the left on \(F\). Let \(G=E\times F\) be endowed with the binary operation \(*\) defined in the following way

$$\begin{aligned} (x_1,x_2)*(y_1,y_2)=(\lambda x_1y_1,x_1y_2+y_1x_2), \end{aligned}$$

where \(\lambda \in E\) is fixed. Note that in the case where \(\lambda =1\) and, for some commutative field \(K\), \((E,\cdot )=(K\setminus \{0\}, \cdot )\) and \((F,+)=(K,+)\), the structure \((G,*)\) is a group which can be identified with a multiplicative group of the matrices of the form

$$\begin{aligned} \left[ \begin{array}{cc} x &{} 0 \\ y &{} x \end{array} \right] , \end{aligned}$$

where \(x\in K\setminus \{0\}\) and \(y\in K\). Thus, in this case, \((G,*)\) is a Clifford group of \(K\). In [9], among others, the subsemigroups of \((G,*)\) of the forms \(\{(x,f(x)):x\in E\}\) where \(f:E\rightarrow F\) and \(\{(f(x),x):x\in F\}\) where \(f:F\rightarrow E\) have been considered. It is clear that the problem of determination of such subsemigroups leads to the functional equations

$$\begin{aligned} f(\lambda xy)=xf(y)+yf(x) \quad \text{ for }\; x,y\in E \end{aligned}$$
(1)

and

$$\begin{aligned} f(f(x)y+f(y)x)=\lambda f(x)f(y) \quad \text{ for }\; x,y\in F, \end{aligned}$$
(2)

respectively. In the case \(E=F=\mathbb {R}\) Eq. (1) can be easily solved by reduction to the Cauchy equation (cf. [9, Proposition11]). However Eq. (2) is much more complicated. According to [9, Theorem12] it has nonconstant continuous solutions \(f:\mathbb {R}\rightarrow \mathbb {R}\) if and only if \(\lambda =2\). Moreover, a nonconstant continuous function \(f:\mathbb {R}\rightarrow \mathbb {R}\) satisfies equation

$$\begin{aligned} f(f(x)y+f(y)x)=2f(x)f(y) \quad \text{ for }\; x,y\in \mathbb {R} \end{aligned}$$
(3)

if and only if there exists a \(c\in \mathbb {R}\setminus \{0\}\) such that either \(f(x)=cx\) for \(x\in \mathbb {R}\), or \(f(x)=\max \{cx,0\}\) for \(x\in \mathbb {R}\) (obviously the only constant solutions of (3) are \(f=0\) and \(f=\frac{1}{2}\)). Numerous examples of discontinuous solutions \(f:\mathbb {R}\rightarrow \mathbb {R}\) of a generalized version of Eq. (3) can be found in [5] and [6]. Related equations have been studied among others in [8] and [13].

In the case where \(X\) is a locally convex real linear topological Hausdorff space, a continuous function \(F:X\rightarrow \mathbb {R}\) satisfies equation

$$\begin{aligned} F(F(x)y+F(y)x)=2F(x)F(y) \quad \text{ for }\; x,y\in X \end{aligned}$$
(4)

if and only if there exist a nontrivial continuous linear functional \(x^{*}\) on the space \(X\) and a continuous function \(f:\mathbb {R}\rightarrow \mathbb {R}\) satisfying Eq. (3) such that \(F=f\circ x^{*}\) (cf. [9, Theorem15]). In a survey paper [14] it has been stated that an analogous result holds in the case where \(X\) is a real linear space and \(F:X\rightarrow \mathbb {R}\) is continuous on rays, that is, for every \(x\in X\setminus \{0\}\), a function \(F_x:\mathbb {R}\rightarrow \mathbb {R}\) given by \(F_x(t)=F(tx)\) for \(t\in \mathbb {R}\), is continuous. More precisely (cf. [14, Theorem3]), a continuous on rays function \(F:X\rightarrow \mathbb {R}\) satisfies Eq. (4) if and only if there exist a nontrivial linear functional \(L:X\rightarrow \mathbb {R}\) and a continuous function \(f:\mathbb {R}\rightarrow \mathbb {R}\) satisfying Eq. (3) such that

$$\begin{aligned} F=f\circ L. \end{aligned}$$
(5)

It is remarkable that the continuity on rays is a very natural assumption. In fact, as one can easily note, it is a necessary condition for \(F\) to have a decomposition of the form (5) with some nontrivial linear functional \(L:X\rightarrow \mathbb {R}\) and a continuous function \(f:\mathbb {R}\rightarrow \mathbb {R}\). Unfortunately the result is not true. To see this it is enough to take a function \(F:\mathbb {R}^2\rightarrow \mathbb {R}\) of the form

$$\begin{aligned} F(x,y)=\left\{ \begin{array}{lcl} x &{} \text{ whenever } &{} x\ge 0 \; \text{ and } \; y=0,\\ 0 &{} \text{ otherwise. } &{} \\ \end{array} \right. \end{aligned}$$

Obviously \(F\) is continuous on rays and satisfies (4), but it can not be represented in the form (5) with a nontrivial linear functional \(L:X\rightarrow \mathbb {R}\) and a continuous function \(f:\mathbb {R}\rightarrow \mathbb {R}\) satisfying Eq. (3).

In this paper we give a description of the continuous on rays solutions of Eq. (4). Applying this result, we show that decomposition (5) holds for every solution \(F:X\rightarrow \mathbb {R}\) of Eq. (4) satisfying the assumption:

\((A)\)     for every \(x,y\in X\) the following map \(\phi _{(x,y)}:\mathbb {R}\rightarrow \mathbb {R}\) is continuous

$$\begin{aligned} \phi _{(x,y)}(t)=F(x+ty) \quad \text{ for } \; t\in \mathbb {R}. \end{aligned}$$

As a consequence of our results we obtain a generalization of [9, Theorem15].

2 Results

Theorem 1

Let \(X\) be a real linear space and let \(F:X\rightarrow \mathbb {R}\) be a nonconstant function continuous on rays. Then \(F\) satisfies Eq. (4) if and only if the following three conditions hold:

  1. (i)

    \(F(X)\in \{[0,\infty ), \mathbb {R}\}\);

  2. (ii)

    \(F(\lambda x)=\lambda F(x)\) for \(x\in X\), \(\lambda \in F(X)\);

  3. (iii)

    \(F^{-1}(\{1\}):=\{x\in X|F(x)=1\}\) is a mid-convex set, that is for every \(x,y\in X\), we have

    $$\begin{aligned} F(x)=F(y)=1 \Longrightarrow F\left( \frac{x+y}{2}\right) =1. \end{aligned}$$

Proof

Assume that conditions \((i)\)-\((iii)\) hold and fix \(x,y\in X\). If \(F(x)=0\) then making use of \((ii)\), we get \(F(F(x)y+F(y)x)=F(F(y)x)=F(x)F(y)=0=2F(x)F(y)\). If \(F(y)=0\) then the similar arguments work. So, assume that \(F(x)F(y)\ne 0\). Then, applying \((i)\) and \((ii)\), we have \(F(x)=F\left( F(x)\frac{x}{F(x)}\right) =F(x)F\left( \frac{x}{F(x)}\right) \), whence \(F\left( \frac{x}{F(x)}\right) =1\). Similarly, we get \(F\left( \frac{y}{F(y)}\right) =1\). Note also that in view of \((i)\), we have \(2F(x)F(y)\in F(X)\). Therefore, making use of \((ii)\) and \((iii)\), we obtain

$$\begin{aligned} F(F(x)y+F(y)x)=2F(x)F(y)F\left( \frac{1}{2}\left( \frac{x}{F(x)} +\frac{y}{F(y)}\right) \right) =2F(x)F(y). \end{aligned}$$

So, we have proved that \(F\) satisfies (4).

Now, assume that \(F\) satisfies (4). Applying (4) with \(x=y=0\), we get \(F(0)\in \left\{ 0,\frac{1}{2}\right\} \). Suppose that \(F(0)=\frac{1}{2}\). Then, setting in (4) \(y=0\), we obtain \(F\left( \frac{x}{2}\right) =F(x)\) for \(x\in X\) and so \(F_x\left( \frac{t}{2}\right) =F\left( \frac{tx}{2}\right) =F(tx)=F_x(t)\) for \(x\in X\), \(t\in \mathbb {R}\). Hence, by iteration, we get \(F_x\left( \frac{t}{2^n}\right) =F_x(t)\) for \(x\in X\), \(t\in \mathbb {R}\) and \(n\in \mathbb {N}\). Since \(F\) is continuous on rays, putting in the last equality \(t=1\) and letting \(n\rightarrow \infty \), we conclude that \(F(x)=F_x(1)=F_x(0)=F(0)=\frac{1}{2}\) for \(x\in X\), which yields a contradiction. So, we have proved that \(F(0)=0\). Furthermore, in view of (4), for every \(x\in X\), \(F_x\) satisfies Eq. (3). Since, for every \(x\in X\), \(F_x\) is continuous and \(F_x(0)=F(0)=0\), applying [9, Theorem12], we conclude that for every \(x\in X\) either \(F_x=0\) or there exists a \(c(x)\in \mathbb {R}\setminus \{0\}\) such that one of the following two possibilities holds:

$$\begin{aligned} F_x(t)&= c(x)t \quad \text{ for }\; t\in \mathbb {R}, \end{aligned}$$
(6)
$$\begin{aligned} F_x(t)&= \max \{c(x)t,0\} \quad \text{ for }\; t\in \mathbb {R}. \end{aligned}$$
(7)

Let \(X_{(1)}=\{x\in X:F_x=0\}\),

$$\begin{aligned} X_{(2)}=\{x\in X:(6)\; \text{ holds } \text{ with } \text{ some }\; c(x)\ne 0\} \end{aligned}$$

and

$$\begin{aligned} X_{(3)}=\{x\in X:(7)\; \text{ holds } \text{ with } \text{ some }\; c(x)\ne 0\}. \end{aligned}$$

Obviously \(X_{(1)}\), \(X_{(2)}\) and \(X_{(3)}\) are pairwise disjoint and \(X_{(1)}\cup X_{(2)}\cup X_{(3)}=X\). Suppose that the sets \(X_{(2)}\) and \(X_{(3)}\) are nonempty and fix an \(x\in X_{(2)}\) and a \(y\in X_{(3)}\). Then \(F\left( -\frac{y}{c(y)}\right) =F_y\left( -\frac{1}{c(y)}\right) =0\), so in view of (4), we obtain

$$\begin{aligned} F_y\left( -\frac{c(x)}{c(y)}t\right)&=F\left( -\frac{y}{c(y)}c(x)t\right) =F\left( -\frac{y}{c(y)}F_x(t)\right) =F\left( -\frac{y}{c(y)}F(tx)\right) \\&=F\left( -\frac{y}{c(y)}F(tx)+txF\left( -\frac{y}{c(y)}\right) \right) =2F\left( -\frac{y}{c(y)}\right) \\&\qquad \times F(tx)=0 \;\; \text{ for } \;\; t\in \mathbb {R}. \end{aligned}$$

Thus \(F_y=0\), which gives a contradiction. Hence \(X_{(2)}=\emptyset \) or \(X_{(3)}=\emptyset \). First consider the case where \(X_{(3)}=\emptyset \). As \(F\) is nonconstant, we have \(X_{(2)}\ne \emptyset \), which implies that \(F(X)=\mathbb {R}\). Furthermore, according to (6), for every \(x\in X_{(2)}\) and \(\lambda \in \mathbb {R}\), we obtain \(c(\lambda x)=F_{\lambda x}(1)=F(\lambda x)=F_x(\lambda )=c(x)\lambda \). Since, in view of (6), \(F(x)=F_x(1)=c(x)\) for \(x\in X\), this means that \(F(\lambda x)=\lambda F(x)\) for \(x\in X_{(2)}\) and \(\lambda \in \mathbb {R}\). Obviously we have also \(F(\lambda x)=F_x(\lambda )=0=\lambda F_x(1)=\lambda F(x)\) for \(x\in X_{(1)}\) and \(\lambda \in \mathbb {R}\), so \((ii)\) is valid.

From \((ii)\) it follows that \(F\left( \frac{x}{2}\right) =\frac{1}{2}F(x)\) for \(x\in X\). Therefore, taking \(x,y\in X\) with \(F(x)=F(y)=1\) and applying (4), we get

$$\begin{aligned} F\left( \frac{x+y}{2}\right) =\frac{1}{2}F(x+y)=\frac{1}{2}F(F(x)y+F(y)x)=F(x)F(y)=1. \end{aligned}$$

Hence \((iii)\) holds.

In the case where \(X_{(2)}=\emptyset \), we have \(X_{(3)}\ne \emptyset \) and so \(F(X)=[0,\infty )\). Thus, repeating the arguments from the previous case, we conclude that \((i)\)-\((iii)\) hold.

\(\square \)

Remark 1

Note that if \(X\) is a real linear space then every function \(F:X\rightarrow \mathbb {R}\) satisfying (i)–(iii) can be obtained in the following way. Fix an arbitrary nonempty mid-convex set \(A\subset X\) such that any two elements of \(A\) are linearly independent. Moreover, let \(T\in \{(0,\infty ), \mathbb {R}\setminus \{0\}\}\). Then, for every \(x\in X\), put \(F(x)=\frac{1}{t}\) whenever \(tx\in A\) with some \(t\in T\) and \(F(x)=0\), otherwise.

Theorem 2

Assume that \(X\) is a real linear space, a function \(F:X\rightarrow \mathbb {R}\) is nonconstant and \((A)\) holds. Then \(F\) satisfies Eq. (4) if and only if either \(F\) is linear or there exists a nontrivial linear functional \(L:X\rightarrow \mathbb {R}\) such that

$$\begin{aligned} F(x)=\max \{L(x),0\} \quad \text{ for }\; x\in X. \end{aligned}$$
(8)

Proof

Assume that \(F\) satisfies (4). Since, in view of \((A)\), for every \(x\in X\setminus \{0\}\), the mapping \(\phi _{(0,x)}\) is continuous, \(F\) is continuous on rays. Then, according to Theorem 1, conditions \((i)\)-\((iii)\) hold. From \((i)\) and \((ii)\) it follows that the set \(F^{-1}(\{1\})\) is nonempty and \(F\) is positively homogeneous. Let \(x,y\in F^{-1}(\{1\})\) and \(T_{(x,y)}:=\{t\in [0,1]:\phi _{(y,x-y)}(t)=1\}\). Then \(T_{(x,y)}\) is a closed set containing \(0\) and \(1\). Moreover, in view of \((iii)\), \(T_{(x,y)}\) is mid-convex. Thus \(T_{(x,y)}=[0,1]\) and so

$$\begin{aligned} F(tx+(1-t)y)=F(y+t(x-y))=\phi _{(y,x-y)}(t)=1 \quad \text{ for } \; t\in [0,1]. \end{aligned}$$

As \(x,y\in F^{-1}(\{1\})\) are arbitrarily fixed, this means that \(F^{-1}(\{1\})\) is convex. The remaining part of the proof is divided into 3 steps.

Step 1. We show that, for every \(x,y\in X\) and \(\lambda \in \mathbb {R}\), the following implication holds

$$\begin{aligned} F(x)=F(y)=1 \Longrightarrow F(\lambda x+(1-\lambda )y)=1. \end{aligned}$$
(9)

Suppose that (9) does not hold. Then \(\phi _{(y,x-y)}(\lambda _0)=F(\lambda _0x+(1-\lambda _0)y)\ne 1\) for some \(x,y\in X\) with \(F(x)=F(y)=1\) and \(\lambda _0\in \mathbb {R}\). On the other hand, as \(F^{-1}(\{1\})\) is convex, we have \(\phi _{(y,x-y)}(t)=1\) for \(t\in [0,1]\). Hence \(\lambda _0\in \mathbb {R}\setminus [0,1]\) and, due to the continuity of \(\phi _{(y,x-y)}\), there exists a \(\lambda _1\in \mathbb {R}\setminus [0,1]\) such that

$$\begin{aligned} \phi _{(y,x-y)}(\lambda _1)\in (0,\infty )\setminus \{1\}. \end{aligned}$$
(10)

Let \(z=\frac{y+\lambda _1(x-y)}{\phi _{(y,x-y)}(\lambda _1)}\). Since \(F\) is positively homogeneous, in view of (10), we have \(F(z)=1\). Moreover if \(\lambda _1>1\) then \(\lambda _2:=\frac{\phi _{(y,x-y)}(\lambda _1)}{\phi _{(y,x-y)} (\lambda _1)+2\lambda _1-1}\in (0,1)\) and \(\lambda _2z+(1-\lambda _2)y=\frac{\lambda _1}{\phi _{(y,x-y)}(\lambda _1) +2\lambda _1-1}(x+y)\). Since \(F(y)=F(z)=1\) and \(F^{-1}(\{1\})\) is convex, this implies that \(F\left( \frac{\lambda _1}{\phi _{(y,x-y)}(\lambda _1)+2\lambda _1-1}(x+y)\right) =1\). Hence, as \(F\) is positively homogeneous, taking into account \((iii)\), we obtain \(\frac{2\lambda _1}{\phi _{(y,x-y)}(\lambda _1)+2\lambda _1-1}=1\). Thus \(\phi _{(y,x-y)}(\lambda _1)=1\), which contradicts (10). If \(\lambda _1<0\) then taking \(\lambda _3:=\frac{\phi _{(y,x-y)}(\lambda _1)}{\phi _{(y,x-y)}(\lambda _1)+1-2\lambda _1}\), we get \(\lambda _3\in (0,1)\) and \(\lambda _3z+(1-\lambda _3)x=\frac{1-\lambda _1}{\phi _{(y,x-y)} (\lambda _1)+1-2\lambda _1}(x+y)\). Hence, arguing as previously, we obtain a contradiction. In this way we have proved (9).

Step 2. Fix an \(x_0\in F^{-1}(\{1\})\) and put \(A:=F^{-1}(\{1\})-x_0\). Since \(F\) is positively homogeneous, we have \(x_0\not \in A\). We show that \(A\) is a linear subspace of \(X\) with a codimension 1. Obviously \(0\in A\). Moreover, if \(a\in A\) then \(a=x-x_0\) with some \(x\in F^{-1}(\{1\})\) and so, making use of (9), for every \(\lambda \in \mathbb {R}\), we get \(\lambda a+x_0=\lambda x+(1-\lambda )x_0\in F^{-1}(\{1\})\). Thus

$$\begin{aligned} \lambda a\in A \quad \text{ for } \; a\in A, \lambda \in \mathbb {R}. \end{aligned}$$
(11)

Next, taking \(a_1,a_2\in A\), we get \(a_i=x_i-x_0\) with some \(x_i\in F^{-1}(\{1\})\), \(i\in \{1,2\}\). Hence, as \(F^{-1}(\{1\})\) is convex, we obtain \(\frac{a_1+a_2}{2}=\frac{x_1+x_2}{2}-x_0\in A\) which, in view of (11), gives \(a_1+a_2\in A\). Therefore \(A\) is a linear subspace of \(X\). In order to prove that its codimension is equal to \(1\) it is enough to show that \(\text{ Lin }\;(A\cup \{x_0\})=X\). To this end fix a \(y\in X\). If \(F(y)\ne 0\) then in view of \((i)\) and \((ii)\) we get \(F\left( \frac{y}{F(y)}\right) =1\). Hence \(\frac{y}{F(y)}\in F^{-1}(\{1\})\) and so \(\frac{y}{F(y)}-x_0\in A\). Thus \(y\in \text{ Lin }\;(A\cup \{x_0\})\). If \(F(y)=0\) then \(\phi _{(y,x_0-y)}(0)=F(y)=0\) and \(\phi _{(y,x_0-y)}(1)=F(x_0)=1\). Since \(\phi _{(y,x_0-y)}\) is continuous, this means that \(\phi _{(y,x_0-y)}(t)\in (0,1)\) for some \(t\in (0,1)\). Hence, as \(F\) is positively homogeneous, we get \(\frac{y+t(x_0-y)}{\phi _{(y,x_0-y)}(t)}\in F^{-1}(\{1\})\). Thus \(\frac{y+t(x_0-y)}{\phi _{(y,x_0-y)}(t)}-x_0\in A\) and so \(y\in \text{ Lin }\;(A\cup \{x_0\})\). In this way we have proved that a codimension of \(A\) is equal to \(1\).

Step 3. Since \(A\) is a linear subspace of \(X\) with a codimension \(1\), there exists a linear functional \(L_A:X\rightarrow \mathbb {R}\) such that \(\ker L_A=A\). Furthermore, for every \(x\in X\), there exist uniquely determined \(a(x)\in A\) and \(\lambda (x)\in \mathbb {R}\) such that

$$\begin{aligned} x=a(x)+\lambda (x)x_0. \end{aligned}$$
(12)

Let \(L:=\frac{L_A}{L_A(x_0)}\). Then \(L\) is a nontrivial linear functional and, in view of (12), we get \(\lambda (x)=L(x)\) for \(x\in X\). According to \((i)\) either \(F(X)=\mathbb {R}\) or \(F(X)=[0,\infty )\). In the first case from \((ii)\) we derive that \(F\) is homogeneous. Moreover \(a(x)+x_0\in A+x_0=F^{-1}(\{1\})\) for \(x\in X\). Therefore, taking into account (9) and (12), we obtain

$$\begin{aligned} F(x)&= F(a(x)+\lambda (x)x_0)=F(a(x)+x_0+(\lambda (x)-1)x_0)\\&= \lambda (x)F\left( \frac{1}{\lambda (x)}(a(x)+x_0) +\left( 1-\frac{1}{\lambda (x)}\right) x_0\right) =\lambda (x)=L(x) \quad \text{ for } \; x\in X, \end{aligned}$$

so \(F\) is linear.

In the second case, as \(F\) is positively homogeneous, the similar arguments show that \(F(x)=L(x)\) for \(x\in X\) with \(L(x)>0\). Thus \(F\) is of the form (8).

It is easy to check that if \(F\) is linear or \(F\) is of the form (8) with some nontrivial linear functional \(L:X\rightarrow \mathbb {R}\) then \(F\) satisfies (4). \(\square \)

Taking into account [9, Theorem12], we can reformulate Theorem 2 in the following way.

Theorem 3

Assume that \(X\) is a real linear space, \(F:X\rightarrow \mathbb {R}\) and \((A)\) holds. Then \(F\) satisfies Eq. (4) if and only if there exists a nontrivial linear functional \(L:X\rightarrow \mathbb {R}\) and a continuous function \(f:\mathbb {R}\rightarrow \mathbb {R}\) satisfying (3) such that \(F=f\circ L\).

From Theorem 3 we derive the following result, which generalizes [9, Theorem15].

Theorem 4

Let \(X\) be a real linear topological Hausdorff space. A continuous function \(F:X\rightarrow \mathbb {R}\) satisfies Eq. (4) if and only if there exists a nontrivial continuous linear functional \(x^*\) on the space \(X\) and a continuous function \(f:\mathbb {R}\rightarrow \mathbb {R}\) satisfying (3) such that \(F=f\circ x^*\).