1 Introduction

General Relativity (GR) or Einstein’s theory of gravitation [1, 2], is the best theory of gravitation for describing large-scale interactions. The GR has been successfully tested through several observational results, such as the predicted value for the advance of Mercury’s perihelion, the bending of light around the Sun, gravitational redshift, detection of gravitational waves, among others [3, 4]. It is clear that GR is an established theory, however some challenges need to be resolved. The most important challenges are: (i) it is a classical theory, i.e., there is no quantum version of GR as there is for the other fundamental forces of nature and (ii) the accelerated expansion of the universe, confirmed by various observational tests [5,6,7]. Since GR does not explain these problems, alternative theories are constructed and investigated.

Over the years, some models have been proposed to try to explain the accelerated expansion of the universe. There are two different ways to develop these theories, one adds an exotic component of energy, called dark energy [8,9,10,11,12], and the other modifies or generalizes the Einstein-Hilbert action. Such modifications change the geometry or matter or both parts of the Einstein field equations. The simplest extension of GR is obtained by replacing the Ricci scalar R in the Einstein-Hilbert action with a general function of R, leading to f(R) theories of gravity [13,14,15]. Another interesting generalization is the f(RT) gravity, where the gravitational action is an arbitrary function of the Ricci scalar R and of the trace of the energy–momentum tensor T [16]. It is important to note that f(R) and f(RT) are two of several models of modified gravity theory. For a review of modified gravity theories, see [17, 18].

In this work, the \(f(R,T^2)\) gravity is considered. This is a theory where the gravitational Lagrangian depends on the Ricci scalar R and on the contraction of the energy–momentum tensor with itself, i.e., \(T^2=T_{\mu \nu }T^{\mu \nu }\) [19,20,21]. It should be noted that the field equations differ from GR only in the presence of matter sources. The term \(f(T_{\mu \nu }T^{\mu \nu })\) can be introduced in different ways, which leads to different versions of the theory. For example, the version with \(f(T_{\mu \nu }T^{\mu \nu })\propto (T_{\mu \nu }T^{\mu \nu })^\eta \) is known as energy–momentum powered gravity, where \(\eta \) is a constant. While the model with \(f(T_{\mu \nu }T^{\mu \nu })\propto \ln (T_{\mu \nu }T^{\mu \nu })\) is called energy–momentum log gravity. This theory has received a lot of attention and has been studied in different contexts. In [22] the cosmic acceleration via energy–momentum powered gravity has been studied. Cosmological models including bulk viscous cosmology, loop quantum gravity, k-essence, and brane-world cosmologies in energy–momentum-squared gravity have been discussed [21]. An extension of the standard \(\Lambda \)CDM model in energy–momentum log gravity has been investigated [23]. Constraints on the energy–momentum squared gravity from neutron stars and its cosmological implications have been considered [24]. Spherically symmetric compact stars have been analyzed [25]. Dynamical system analysis for various types of gravity functions \(f(R,T^2)\) has been used and the structure of the phase space and the physical implications have been studied [26]. The viability of bouncing cosmology has been explored [27]. A generalized version of energy–momentum squared gravity in the Palatini formalism has been constructed [28]. Quasinormal modes of perturbed black holes have been discussed [29]. A particular model of energy–momentum squared gravity, called scale-independent energy–momentum squared gravity, has been developed and some implications have been considered [30]. Although the energy–momentum squared gravity has been tested in several contexts, the question of causality and its possible violation has not been developed. Therefore, the main objective of this paper is to address a study on causality. For such a construction, the Gödel-type solution is considered.

An exact solution of the GR field equations was proposed by Kurt Gödel in 1949 [31]. This solution describes a pressureless perfect fluid in rotation, without expansion and exhibits cylindrical symmetry. This cosmological model has as its main characteristic the possibility of Closed Time-like Curves (CTCs). These CTCs allow an observer to go back into the past, which leads to the violation of causality. However, it is important to note that in GR the space-times locally have the same causal structure of the special relativity. But on a non-local scale, the causality can be violated. CTCs is not a unique feature of the Gödel metric, there are other cosmological models that exhibit similar curves, such as van Stockum cylinder [32], Kerr space-time [33], cosmic string [34], among others. In order to calculate a critical radius, beyond which the causality is violated, a generalization of the Gödel metric, called Gödel-type metric [35], is considered. In this context, let’s verify the consistency of the field equations of \(f(R,T^2)\) gravity in a cosmological background defined by the Gödel and Gödel-type metrics. Considering different content of matter, causal and non-causal regions arise in this gravitational model.

The present paper is organized as follows. In Sect. 2, an introduction to the \(f(R,T^2)\) gravity is made. In Sect. 3, the Gödel metric is introduced and the field equations are solved. The causality problem is discussed. In Sect. 4, the Gödel-type metric is considered. First, a perfect fluid is chosen as the content of matter. In this case, the causality is naturally violated. A critical radius, which defines causal and non-causal regions, is calculated. Then, in order to find a causal region, different matter contents are introduced, such as perfect fluid and a scalar field together and only a scalar field. In Sect. 5, remarks and conclusions are presented.

2 \(f(R,T^{2})\) modified gravity

In this section, the main objective is to obtain the field equations of \(f(R,T^{2})\) gravity, with \(T^2=T_{\mu \nu }T^{\mu \nu }\). The action that describes this theory is,

$$\begin{aligned} \mathcal {S}{} & {} =\frac{1}{2\kappa }\int \sqrt{-g}\left( f\left( R,T^{\mu \nu }T_{\mu \nu }\right) +2\Lambda \right) d^{4}x\nonumber \\{} & {} \quad +\int { \mathcal {L}_{m}\sqrt{-g}d^{4}x}, \end{aligned}$$
(1)

where \(\kappa =8\pi G\) with G being the gravitational constant, g is the determinant of the metric, R is the Ricci scalar, \(\Lambda \) is the cosmological constant, \(\mathcal {L}_m\) is matter Lagrangian and \(T_{\mu \nu }\) is the energy–momentum tensor which is defined as

$$\begin{aligned} T_{\mu \nu }=-\frac{2}{\sqrt{-g}}\frac{\delta (\sqrt{-g}\mathcal {L}_{m})}{\delta g^{\mu \nu }}. \end{aligned}$$
(2)

Considering that \(\mathcal {L}_{m}\) depends only on the metric components, and not on their derivatives, the energy–momentum tensor becomes

$$\begin{aligned} T_{\mu \nu }=g_{\mu \nu }\mathcal {L}_{m}-2\frac{\partial \mathcal {L}_{m}}{\partial g^{\mu \nu }}. \end{aligned}$$
(3)

The variation of Eq. (1) leads to

$$\begin{aligned} \delta \mathcal {S}{} & {} =\frac{1}{2\kappa }\int \sqrt{-g} \left\{ f_{R}\delta R+f_{T^{2}}\delta T^2-\frac{1}{2}g_{\mu \nu }f\delta g^{\mu \nu }\right. \nonumber \\{} & {} \quad \left. -g_{\mu \nu }\Lambda \delta g^{\mu \nu }+\frac{1}{\sqrt{-g}}\delta \left( \sqrt{-g}\mathcal {L}_{m}\right) \right\} d^{4}x. \end{aligned}$$
(4)

Here, for simplicity, have been defined \(f=f(R,T_{\mu \nu }T^{\mu \nu })\), \(f_R=\frac{\partial f}{\partial R}\) and \(f_{T^2}=\frac{\partial f}{\partial T^2}\). The variation of the Ricci scalar is known and gives the result

$$\begin{aligned} \delta R=R_{\mu \nu }\delta g^{\mu \nu }+g_{\mu \nu }\Box \delta g^{\mu \nu }-\nabla _\mu \nabla _\nu \delta g^{\mu \nu }. \end{aligned}$$
(5)

Taking the variation of \(T^2\) with respect to the metric we obtain

$$\begin{aligned} \Theta _{\mu \nu }\equiv & {} \frac{\delta (T_{\alpha \beta }T^{\alpha \beta })}{\delta g^{\mu \nu }}=\frac{(\delta T_{\alpha \beta })}{\delta g^{\mu \nu }}T^{\alpha \beta } +T_{\alpha \beta }\frac{(\delta T^{\alpha \beta })}{\delta g^{\mu \nu }}\nonumber \\= & {} \frac{(\delta T_{\alpha \beta })}{\delta g^{\mu \nu }}T^{\alpha \beta } +2T_{\mu }^{\alpha }T_{\nu \alpha }+T^{\alpha \beta }\frac{\delta T_{\alpha \beta }}{\delta g^{\mu \nu }}. \end{aligned}$$
(6)

Using Eq. (3), the variation in the energy–momentum tensor given in Eq. (6) is written as

$$\begin{aligned} \frac{(\delta T_{\alpha \beta })}{\delta g^{\mu \nu }}T^{\alpha \beta }{} & {} =-\mathcal {L}_{m}T_{\mu \nu }-\frac{1}{2}TT_{\mu \nu }+\frac{1}{2}g_{\mu \nu }\mathcal {L}_{m}T\nonumber \\{} & {} \quad -2\frac{\partial ^{2} \mathcal {L}_{m}}{\partial g^{\mu \nu } \partial g^{\alpha \beta }}T^{\alpha \beta }. \end{aligned}$$
(7)

With this result, Eq. (6) becomes

$$\begin{aligned} \theta _{\mu \nu }{} & {} = -2\mathcal {L}_{m}\left( T_{\mu \nu }-\frac{1}{2}g_{\mu \nu }T \right) -TT_{\mu \nu } + 2T_{\mu }^{\alpha }T_{\nu \alpha }\nonumber \\{} & {} \quad -4T^{\alpha \beta }\frac{\partial ^{2} \mathcal {L}_{m}}{\partial g^{\mu \nu } \partial g^{\alpha \beta }}. \end{aligned}$$
(8)

Thus, returning to Eq. (4), the field equations of the \(f(R,T^2)\) gravity model are given as

$$\begin{aligned}{} & {} f_{R}R_{\mu \nu }-\frac{1}{2}fg_{\mu \nu }-\Lambda g_{\mu \nu }+\left( g_{\mu \nu }\nabla _{\alpha }\nabla ^{\alpha }-\nabla _{\mu }\nabla _{\nu }\right) \nonumber \\{} & {} \quad \times f_{R} =\kappa (T_{\mu \nu }-\frac{1}{\kappa }f_{T^{2}}\Theta _{\mu \nu }). \end{aligned}$$
(9)

Note that for a proper choice of function \(f(R, T^2)\) other modified gravities can be obtained, for example, \(f=f(R)\) leads to f(R) gravity while \(f=f(R,T)\) implies in the field equations of f(RT) gravity theory.

In the next sections, the field equations (9) will be considered to investigate whether this gravitational model allows for the existence of CTCs, which leads to non-causal regions. First, the original Gödel solution is analyzed, and then a generalized model is studied.

3 Gödel metric in \(f(R,T^2)\) gravity

The Gödel metric was proposed by mathematician and logician Kurt Gödel in 1949 [31]. It is an exact solution of the field equations of general relativity that allows the existence of Closed Time-like Curves (CTCs). This means that an observer moving on a CTC can find a point in the future that is also his starting point in the past. It is worth noting that the existence of CTCs in the Gödel metric is considered paradoxical, as it allows past and future events to interact. However, the exact solution of the Gödel metric is interesting from a theoretical point of view and has been studied in several areas of physics and mathematics. The line element that describes this universe is given as

$$\begin{aligned} ds^{2}=a^{2}\left( dt^{2}-dx^{2}+\frac{e^{2x}}{2}dy^{2}-dz^{2}+2e^{x}dtdy\right) , \end{aligned}$$
(10)

where a is a positive constant. The main ingredients associated with Eq. (10) for working with Eq. (9) are: (i) the components of metric and its inverse

$$\begin{aligned}{} & {} g_{\mu \nu }=a^{2}\left( \begin{array}{cccc} 1 &{} 0 &{} e^{x} &{} 0\\ 0 &{} -1 &{} 0 &{} 0\\ e^{x} &{} 0 &{} \frac{e^{2x}}{2} &{} 0\\ 0 &{} 0 &{} 0 &{} -1 \end{array}\right) , \end{aligned}$$
(11)
$$\begin{aligned}{} & {} g^{\mu \nu }=\frac{1}{a^{2}}\left( \begin{array}{cccc} -1 &{} 0 &{} 2e^{-x} &{} 0\\ 0 &{} -1 &{} 0 &{} 0\\ 2e^{-x} &{} 0 &{} -2e^{-2x} &{} 0\\ 0 &{} 0 &{} 0 &{} -1 \end{array}\right) ; \end{aligned}$$
(12)

(ii) the non-zero Ricci tensor components

$$\begin{aligned} R_{00}=1;\,\,R_{02}=e^{x};\,\,R_{22}=e^{2x}, \end{aligned}$$
(13)

and (iii) Ricci scalar

$$\begin{aligned} R=\frac{1}{a^2}. \end{aligned}$$
(14)

In addition to these geometry elements, a matter content must be considered. Here, a perfect fluid is chosen, whose energy–momentum tensor is defined as

$$\begin{aligned} T_{\mu \nu }=(\rho +p)u_{\mu }u_{\nu } - pg_{\mu \nu }, \end{aligned}$$
(15)

where \(\rho \) is the energy density, p is the pressure and u is a unit time-like vector whose covariant components are \(u_\mu =(a,0,ae^x,0)\). Explicitly, the components of the energy–momentum tensor are given as

$$\begin{aligned} T_{\mu \nu }=\left( \begin{array}{cccc} \rho a^{2} &{} 0 &{} \rho a^{2}e^{x} &{} 0\\ 0 &{} pa^{2} &{} 0 &{} 0\\ \rho a^{2}e^{x} &{} 0 &{} \left( \rho +\frac{p}{2}\right) a^{2}e^{2x} &{} 0\\ 0 &{} 0 &{} 0 &{} 0 \end{array}\right) . \end{aligned}$$
(16)

Taking the Lagrangian \(\mathcal {L}_{m}=-p\), which describes a perfect fluid, and the energy–momentum tensor defined in Eq. (15), the tensor \( \Theta _{\mu \nu }\) given in Eq. (8) can be written as

$$\begin{aligned} \varTheta _{\mu \nu }=-(\rho ^{2}-p^{2})u_{\mu }u_{\nu }, \end{aligned}$$
(17)

whose components are

$$\begin{aligned} \varTheta _{\mu \nu }=\left( \begin{array}{cccc} -(\rho ^{2}-p^{2})a^{2} &{} 0 &{} -(\rho ^{2}-p^{2})a^{2}e^{x} &{} 0\\ 0 &{} 0 &{} 0 &{} 0\\ -(\rho ^{2}-p^{2})a^{2}e^{x} &{} 0 &{} -(\rho ^{2}-p^{2})a^{2}e^{2x} &{} 0\\ 0 &{} 0 &{} 0 &{} 0 \end{array}\right) . \end{aligned}$$
(18)

Now, let’s write the set of field equations. However, it is important to note that the Ricci scalar is a constant value, which implies that the field equation (9) reduces to

$$\begin{aligned} f_{R}R_{\mu \nu }-\frac{1}{2}fg_{\mu \nu }-\Lambda g_{\mu \nu } =\kappa \left( T_{\mu \nu }-\frac{1}{\kappa }f_{T^{2}}\Theta _{\mu \nu }\right) . \end{aligned}$$
(19)

Consequently, the components of the field equations become

$$\begin{aligned} \frac{f_{R}}{a^2}-\frac{1}{2}f-\Lambda= & {} \kappa \rho + f_{T^{2}}(\rho ^2-p^2), \end{aligned}$$
(20)
$$\begin{aligned} \frac{f_{R}}{a^2}-\frac{1}{4}f-\frac{\Lambda }{2}= & {} \kappa \left( \rho +\frac{p}{2}\right) + f_{T^{2}}(\rho ^2-p^2),\end{aligned}$$
(21)
$$\begin{aligned} \frac{1}{2}f+\Lambda= & {} \kappa p. \end{aligned}$$
(22)

Such a set of equations has the solution

$$\begin{aligned} \Lambda= & {} \frac{1}{2}(2\kappa p-f),\end{aligned}$$
(23)
$$\begin{aligned} \rho&{=}&{-}\frac{a^2\kappa \pm \sqrt{4a^2f_{R}f_{T^2}{+}4a^4f_{T^2}^2p^2{-}4a^4f_{T^2}p\kappa +a^4\kappa ^2}}{2a^2f_{T^2}}. \nonumber \\ \end{aligned}$$
(24)

It is important to observe that the \(f(R,T^{2})\) modified gravity allows the Gödel solution, then the existence of CTCs is possible and the causality can be violated in this gravitational theory. Although this is the same consequence obtained in general relativity, the conditions (23) and (24) for solving the set of equations are different. These conditions are strongly dependent on the function \(f(R,T^{2})\) and the matter content. In addition, assuming \(f(R,T^{2})=R\) in Eq. (19) the results of general relativity are recovered.

In the next section, the Gödel metric is generalized in order to obtain more information about causality violation. To discuss the possibility of finding causal and non-causal regions, different matter contents are considered.

4 Gödel-type metric in \(f(R,T^2)\) modified gravity

A generalization of the Gödel solution, known as a Gödel-type solution, was developed in [35]. In this section, the main objective is to investigate the consistency of the Gödel-type metric in \(f(R,T^2)\) theory, as well as to analyze the conditions that lead to non-causal regions. Then, if causality is violated, the critical radius will be calculated. In cylindrical coordinates, the Gödel-type metric is given as

$$\begin{aligned} ds^2=[dt+H(r)d\phi ]^{2}-dr^2-D^2(r)d\phi ^2-dz^2, \end{aligned}$$
(25)

where the functions H(r) and D(r) must obey the relations

$$\begin{aligned} \frac{H'(r)}{D(r)}= & {} 2\omega ,\end{aligned}$$
(26)
$$\begin{aligned} \frac{D''(r)}{D(r)}= & {} m^2. \end{aligned}$$
(27)

Here, the prime means derivative with respect to r, and \(\omega \) and m are free parameters.

The Gödel-type metrics can be classified into three different classes, i.e., (i) hyperbolic class (\(m^2>0\)), (ii) trigonometric class (\(m^2<0\)) and (iii) linear class (\(m^2=0\)). In this work, only the hyperbolic class is considered. For this class, the functions H(r) and D(r) are defined as

$$\begin{aligned} H(r)= & {} \frac{4\omega }{m^2}sinh^2\left( \frac{mr}{2}\right) , \end{aligned}$$
(28)
$$\begin{aligned} D(r)= & {} \frac{1}{m}sinh(mr). \end{aligned}$$
(29)

In order to analyze the possibility of occurrence of CTCs, the line element (25) is written as

$$\begin{aligned} ds^2=-dt^2-2H(r)dtd\phi +dr^2+G(r)d\phi ^2 +dz^2, \end{aligned}$$
(30)

where \(G(r)=D^2(r)-H^2(r)\). The circles defined by \(t, z, r = const\), lead to the existence of CTCs when \(G(r) < 0\) for a certain range of r. In this context, a critical radius, beyond which the causality is violated, is obtained, i.e.,

$$\begin{aligned} r_{c}=\frac{2}{m}sinh^{-1}\left( \frac{4\omega ^2}{m^2}-1\right) ^{-1}. \end{aligned}$$
(31)

From the critical radius, it is important to notice that, for \(m^2=2\omega ^2\) the original Gödel solution is recovered and for \(m^2=4\omega ^2\) the critical radius becomes infinite, implying a causal universe. Therefore, for \(m^2\ge 4\omega ^2\) there are no Gödel-type CTCs, and causality violation is avoided.

To solve the field equations more simply, a new basis is chosen [35]. Then the metric (30) becomes

$$\begin{aligned} ds^2=\eta _{AB}\theta ^{A}\theta ^{B}=\left( \theta ^0 \right) ^{2}-\left( \theta ^1 \right) ^{2}-\left( \theta ^2 \right) ^{2}-\left( \theta ^3 \right) ^{2},\nonumber \\ \end{aligned}$$
(32)

with \(\eta _{AB}=(+,-,-,-)\) and \( \theta ^A=e_{\mu }^{A}dx^{\mu }\). The Latin letters denote the transformed space and \(e_{\mu }^{A}\) are the tetrads. The components of \(\theta ^A\) are

$$\begin{aligned} \theta ^{(0)}= & {} dt+H(r)d\phi ,\end{aligned}$$
(33)
$$\begin{aligned} \theta ^{(1)}= & {} dr,\end{aligned}$$
(34)
$$\begin{aligned} \theta ^{(2)}= & {} D(r)d\phi ,\end{aligned}$$
(35)
$$\begin{aligned} \theta ^{(3)}= & {} dz \end{aligned}$$
(36)

and components of the tetrads are

$$\begin{aligned} e_{0}^{(0)}=1, \, e_{2}^{(0)}=H(r), \,e_{1}^{(1)}=1, \, e_{2}^{(2)}=D(r),\, e_{3}^{(3)}=1. \nonumber \\ \end{aligned}$$
(37)

The inverse of tetrads, which satisfies the condition \(e_{\mu }^{A}e_{B}^{\mu }=\delta _{B}^{A}\), has the following non-zero components

$$\begin{aligned} e_{(0)}^{0}=e_{(1)}^{1}=e_{(3)}^{3}=1,~~ e_{(2)}^{0}=-\frac{H(r)}{D(r)}, ~~ e_{(2)}^{2}=D^{-1}(r).\nonumber \\ \end{aligned}$$
(38)

On this new basis, a flat space-time, the non-zero components of the Ricci tensor are

$$\begin{aligned} R_{(0)(0)}= & {} 2\omega ^2,\end{aligned}$$
(39)
$$\begin{aligned} R_{(1)(1)}= & {} R_{(2)(2)}=2\omega ^2-m^2, \end{aligned}$$
(40)

the scalar curvature is \(R=2(m^2-\omega ^2)\) and the non-zero components of the Einstein tensor are

$$\begin{aligned} G_{(0)(0)}= & {} 3\omega ^2-m^2,\end{aligned}$$
(41)
$$\begin{aligned} G_{(1)(1)}= & {} G_{(2)(2)}=\omega ^2,\end{aligned}$$
(42)
$$\begin{aligned} G_{(3)(3)}= & {} m^2-\omega ^2. \end{aligned}$$
(43)

Now the field equations of \(f(R, T^2)\) gravity will be solved for three different matter contents: (i) perfect fluid, (ii) perfect fluid plus scalar field and (iii) scalar field.

4.1 Perfect fluid

In this subsection, the perfect fluid is taken as the content of matter. The energy–momentum tensor describing this matter in flat space-time is given as

$$\begin{aligned} T_{AB}=\left( \rho +p\right) u_{A}u_{B}-p\eta _{AB}, \end{aligned}$$
(44)

where \(u_{A}=(1,0,0,0)\) and \( T_{AB}=e_{A}^{\mu }e_{B}^{\nu }T_{\mu \nu }\). The non-zero components are

$$\begin{aligned} T_{(0)(0)}=\rho ,\quad \quad \quad T_{(1)(1)}= T_{(2)(2)}= T_{(3)(3)}=p \end{aligned}$$
(45)

and its trace, \(T=T_{AB}\eta ^{AB}\), is

$$\begin{aligned} T=\rho -3p. \end{aligned}$$
(46)

In a similar way, the tensor (17) in this space-time becomes

$$\begin{aligned} \Theta _{AB}=-\left( \rho ^2-p^2\right) u_{A}u_{B}. \end{aligned}$$
(47)

The non-zero component is

$$\begin{aligned} \Theta _{(0)(0)}=-\left( \rho ^2-p^2\right) \end{aligned}$$
(48)

and its trace is given as

$$\begin{aligned} \Theta =-\left( \rho ^2-p^2\right) . \end{aligned}$$
(49)

In local Lorentz co-frame the field equations (9) becomes

$$\begin{aligned}{} & {} f_{R}R_{AB}-\frac{1}{2}f\eta _{AB}-\Lambda \eta _{AB}+\left( \eta _{AB}\nabla _{\alpha }\nabla ^{\alpha }-\nabla _{A}\nabla _{B}\right) f_{R}\nonumber \\{} & {} \quad =\kappa (T_{AB}-\frac{1}{\kappa }f_{T^{2}}\Theta _{AB}). \end{aligned}$$
(50)

Considering that the Ricci scalar is a constant and taking the trace of this Eq. (50) as an important constraint, the field equations take the form

$$\begin{aligned} f_{R}G_{AB}=\kappa T_{AB}-f_{T^2}\Theta _{AB}- \frac{1}{2}\left\{ f+\kappa T-f_{T^{2}}\Theta \right\} \eta _{AB}.\nonumber \\ \end{aligned}$$
(51)

Then, the field equations for the Gödel-type metric with matter content (44) are given by

$$\begin{aligned} 2f_{R}\left( 3\omega ^{2}-m^{2}\right) +F= & {} \kappa \left( \rho +3p\right) +f_{T^{2}}\left( \rho ^{2}-p^{2}\right) ,\nonumber \\\end{aligned}$$
(52)
$$\begin{aligned} 2f_{R}\left( \omega ^{2}\right) -f= & {} \kappa \left( \rho -p\right) +f_{T^{2}}\left( \rho ^{2}-p^{2}\right) ,\nonumber \\\end{aligned}$$
(53)
$$\begin{aligned} 2f_{R}\left( m^2-\omega ^{2}\right) -f= & {} \kappa \left( \rho -p\right) +f_{T^{2}}\left( \rho ^{2}-p^{2}\right) .\nonumber \\ \end{aligned}$$
(54)

Equations (53) and (54) lead to

$$\begin{aligned} f_{R}\left( 2\omega ^2-m^2\right) =0. \end{aligned}$$
(55)

Assuming that \(f_{R}>0\), Eq. (55) gives

$$\begin{aligned} m^2=2\omega ^2. \end{aligned}$$
(56)

This condition defines the original Gödel universe. Therefore, the \(f{(R,T^2)}\) gravity theory with a perfect fluid as matter content allows the existence of CTCs which implies a violation of the causality. In order to obtain more details about the causality violation, the critical radius is calculated. The remaining field equations imply

$$\begin{aligned} m^2f_{R}+f= & {} \kappa \left( \rho +3p\right) +f_{T^{2}}\left( \rho ^{2}-p^{2}\right) ,\end{aligned}$$
(57)
$$\begin{aligned} m^2f_{R}-f= & {} \kappa \left( \rho -p\right) +f_{T^{2}}\left( \rho ^{2}-p^{2}\right) , \end{aligned}$$
(58)

that lead to

$$\begin{aligned} m=\sqrt{\frac{2\kappa \rho +f+2f_{T^{2}}\left( \rho ^{2}-p^{2}\right) }{2f_{R}}}. \end{aligned}$$
(59)

With this result, the critical radius reads

$$\begin{aligned} r_{c}=2sinh^{-1}(1)\sqrt{\frac{2f_{R}}{2\kappa \rho +f+2f_{T^{2}}\left( \rho ^{2}-p^{2}\right) }}. \end{aligned}$$
(60)

Therefore, there is a causality violation beyond this critical radius, which explicitly depends on the choice of the function \(f(R,T^2)\), its derivatives with respect to R and \(T^2\), and the matter content.

4.2 Perfect fluid with scalar field

In the last subsection, it was seen that when the content of matter is just a perfect fluid the causality violation arises naturally. In an attempt to find a causal solution for the Gödel-type metric in \(f(R, T^2)\) gravity, let us consider that the matter distribution has two ingredients, a fluid perfect and a scalar field. Then the total energy–momentum tensor is given

$$\begin{aligned} T_{AB}=T_{AB}^{(M)} + T_{AB}^{(S)}, \end{aligned}$$
(61)

where \(T_{AB}^{(M)}\) is the energy–momentum tensor of the perfect fluid, Eq. (44), and \(T_{AB}^{(S)}\) is the energy–momentum tensor associated with a scalar field, given by

$$\begin{aligned} T_{AB}^{(S)}= \partial _{A}\phi \partial _{B}\phi - \frac{1}{2}\eta _{AB}\,\eta ^{CD} \partial _{C}\phi \partial _{D}\phi . \end{aligned}$$
(62)

For simplicity, and following [35], let’s assume that the scalar field takes the form \(\phi (z) = ez+const\), where e is a constant. Thus, the non-zero components are given as

$$\begin{aligned} T_{(0)(0)}^{(S)}=-T_{(1)(1)}^{(S)}=-T_{(2)(2)}^{(S)}=T_{(3)(3)}^{(S)}=\frac{e^2}{2}. \end{aligned}$$
(63)

The trace of the total energy–momentum tensor is

$$\begin{aligned} T=T_{AB}^{(M)}\eta ^{AB}+T_{AB}^{(S)}\eta ^{AB}=\rho -3p+e^2. \end{aligned}$$
(64)

Considering that the Lagrangian describing the scalar field is given by

$$\begin{aligned} \mathcal {L}_{m}^{S}=\eta ^{MN}\nabla _{M}\phi \nabla _{N}\phi , \end{aligned}$$
(65)

the total tensor \(\Theta _{AB}\) can be written as

$$\begin{aligned} \Theta _{AB}=\Theta _{AB}^{(M)}+\Theta _{AB}^{(S)}, \end{aligned}$$
(66)

where \(\Theta _{AB}^{(M)}\) and \(\Theta _{AB}^{(S)}\) are the parts associated with the perfect fluid and the scalar field, respectively.

Taking these ingredients, the field equations are given as

$$\begin{aligned} 2f_{R}\left( 3\omega ^{2}{-}m^{2}\right) {+}f&{=}&\kappa \left( \rho {+}3p\right) {+}f_{T^{2}}\left( \rho ^{2}{-}p^{2}\right) ,\nonumber \\\end{aligned}$$
(67)
$$\begin{aligned} 2f_{R}\left( \omega ^{2}\right) {-}f&{=}&\kappa \left( \rho -p\right) {+}f_{T^{2}}\left( \rho ^{2}{-}p^{2}\right) ,\nonumber \\\end{aligned}$$
(68)
$$\begin{aligned} 2f_{R}\left( m^2{-}\omega ^{2}\right) {-}f&{=}&\kappa \left( \rho -p\right) {+} 2\kappa e^2{+}f_{T^{2}}\left( \rho ^{2}{-}p^{2}\right) .\nonumber \\ \end{aligned}$$
(69)

This set of equations can be reduced to

$$\begin{aligned} \kappa e^2= & {} f_{R}(m^2-2\omega ^2),\end{aligned}$$
(70)
$$\begin{aligned} \kappa p= & {} \frac{1}{2}f_{R}(2\omega ^2-m^2)+\frac{f}{2},\end{aligned}$$
(71)
$$\begin{aligned} \kappa \rho +f_{T^{2}}\left( \rho ^{2}-p^{2}\right)= & {} \frac{1}{2}f_{R}(6\omega ^2-m^2)-\frac{f}{2}. \end{aligned}$$
(72)

Analyzing these equations, a causal Gödel-type solution arises and is given by

$$\begin{aligned} m^2= & {} 4\omega ^2,\end{aligned}$$
(73)
$$\begin{aligned} f_{R}= & {} \frac{\kappa e^2}{2\omega ^2},\end{aligned}$$
(74)
$$\begin{aligned} \kappa p= & {} -\kappa \rho + f_{T ^{2}}\left( \rho ^{2}-p^{2}\right) =-\omega ^2f_{R}+\frac{f}{2}. \end{aligned}$$
(75)

It is important to emphasize that the condition \(m^2= 4\omega ^2\) leads to \(r_{c}\rightarrow \infty \). Therefore, for this combination of perfect fluid and scalar field as matter content, a causal Gödel-type universe is allowed, i.e., the causality violation is avoided.

4.3 Scalar field

In order to find other causal Gödel-type solutions, let’s assume that the only source of energy and matter is a scalar field \(\phi (z)\). Following the same steps as in the last subsection, it is shown that a unique class of Gödel-type solutions arises, i.e.

$$\begin{aligned} m^2= & {} 4\omega ^2,\end{aligned}$$
(76)
$$\begin{aligned} f_{R}= & {} \frac{\kappa e^2}{2\omega ^2},\end{aligned}$$
(77)
$$\begin{aligned} f= & {} \kappa e^2. \end{aligned}$$
(78)

Therefore, this solution leads to an infinite critical radius, as a consequence, causality breaking is not allowed and there are no CTCs in this Gödel-type universe. A similar analysis has been developed for the f(R) theory [36].

In addition to the investigation developed here, it is important to discuss whether the field equations of \(f(R, T^2)\) can have the form of a perfect fluid. This characteristic implies that any source of field equations that can be reformulated into a perfect fluid form is suitable for solving system dynamics. Considering the definition of perfect scalars, it has been shown that the field equations of some extended theories of gravity contain perfect fluid terms [37,38,39,40]. In order to develop such an analysis for the energy–momentum-squared gravity, let’s write the field equation (9) considering the energy–momentum tensor for the perfect fluid given in Eq. (15) and the expression for \(\Theta _{\mu \nu }\) given in Eq. (17). For simplicity, it is chosen \(f(R, T^2)=R+\lambda T^2\), where \(\lambda \) is an integer. Then the Ricci tensor assumes the perfect fluid form, i.e.,

$$\begin{aligned} R_{\mu \nu }=ag_{\mu \nu }+b u_\mu u_\nu \end{aligned}$$
(79)

with

$$\begin{aligned} a= & {} \frac{R}{2}+\frac{1}{2}\lambda T^2+\Lambda -\kappa p,\end{aligned}$$
(80)
$$\begin{aligned} b= & {} \kappa (\rho +p)+ f_{T ^{2}}(\rho ^2-p^2). \end{aligned}$$
(81)

This reinforces the idea that any term beyond the Ricci curvature scalar R in the gravitational action can be modeled as a perfect fluid. This result does not change the discussions developed in previous sections about Gödel-type universes in their behavior in \(f(R, T^2)\) gravity.

5 Conclusion

The energy–momentum-squared gravity has been considered. This is a class of theories that generalize GR by adding higher order terms of the form \(T_{\mu \nu }T^{\mu \nu }\) to the matter Lagrangian. In this context, the Gödel and Gödel-type solutions have been used to discuss the issue of causality and its violation. For a fluid perfect as the content of matter, it has been shown that the Gödel metric is the solution of \(f(R, T^2)\) gravity for specific values of the energy density \(\rho \) and the cosmological constant \(\Lambda \). This result leads to a violation of causality. At an appropriate limit, the GR results are recovered. For more details about this violation, the Gödel-type is introduced. For simplicity, a local frame is used. In this context, different contents of matter are chosen. Using a perfect fluid as the matter content, the solution of the field equations shows that the violation of causality arises naturally. Here a finite critical radius, which explicitly depends on the function \(f(R, T^2)\) and of matter content, is calculated. The next investigation changes the matter content, now a perfect fluid plus a scalar field is considered. Our results lead to an infinite critical radius, therefore violation of causality is avoided. A similar result is obtained when only one scalar field is taken as matter content. Therefore, the energy–momentum-squared gravity allows Gödel-types solutions, and as a consequence, both causal and non-causal regions emerge for different matter contents. Furthermore, the study developed in this paper is a generalization of the results obtained for f(R) and f(RT) theories. In addition, it is important to note that when the matter term is switched off, our results recover the results obtained by f(R) gravity [36]. In this case, the definition of causal and non-causal regions (which are given by the critical radius) continues to depend on the matter content that is introduced through the energy–momentum tensor.