As far as I understand, you are dealing with one spatial dimension and you are assuming that changing reference frame, the transformation of coordinates read
$$t'=t+c\:,\quad x' = f(x,t)\:.$$
The former just says that both reference frames are adopting the absolute time of classical physics. The latter regards the Cartesian spatial coordinate of a given event which, in the non-primed reference frame, has coordinates $(x,t)$
Hence the coordinates of that event are $(x',t')$ in the other reference frame. I henceforth assume $c=0$ so that $t'=t$ and I will restore that constant at the end of computations. Taking the derivative with respect to $t$ or $t'$ produces the same result and for that reason the constant can be ignored.
Next, you consider the motion of a material point $x=x(t)$ and you want to describe the motion of the same point in the other reference frame:
$$x'(t) = f(x(t),t)\:.$$
Eventually, you want to determine the general function $f$ by assuming that both reference frames are inertial, according with the properties of $x(t)$ and $x'(t)$ for a suitable family of motions.
Well, let us consider the motion law of isolated material points, also assuming to have at our disposal such a point in every chosen event and that we are free to fix its initial velocity with respect to a given referece frame (the non-primed one).
Since both reference frames are inertial, the motion of such points has constant velocity, i.e. $a(t)=0$ and $a'(t)=0$ simultaneously.
Hence, from
$$a'(t) = a(t) \frac{\partial f}{\partial x}|_{(x(t),t)} + v(t)^2 \frac{\partial^2 f }{\partial x^2}|_{(x(t),t)} + 2v(t) \frac{\partial^2 f }{\partial x \partial t }|_{(x(t),t)} + \frac{\partial^2 f }{\partial t^2}|_{(x(t),t)}$$
we find
$$0 = v(t)^2 \frac{\partial^2 f }{\partial x^2}|_{(x(t),t)} + 2v(t) \frac{\partial^2 f }{\partial x \partial t }|_{(x(t),t)} + \frac{\partial^2 f }{\partial t^2}|_{(x(t),t)}\:.$$
Let us focus attention on what happens at the initial instant $t=0$ (which however can be fixed arbitrarily) where we can freely choose the initial velocity $v(0)$ and the initial position $x(0)$ of our material point in the non-primed inertial reference frame:
$$0 = v(0)^2 \frac{\partial^2 f }{\partial x^2}|_{(x(0),0)} + 2v(0) \frac{\partial^2 f }{\partial x \partial t }|_{(x(0),0)} + \frac{\partial^2 f }{\partial t^2}|_{(x(0),0)}\:.$$
By choosing $v(0)=0$, we find that
$$\frac{\partial^2 f }{\partial t^2}|_{(x(0),0)}=0\:,$$
so that the initial identity specialises to
$$0 = v(0)^2 \frac{\partial^2 f }{\partial x^2}|_{(x(0),0)} + 2v(0) \frac{\partial^2 f }{\partial x \partial t }|_{(x(0),0)}\:.$$
Here, for instance choosing first $v(0)=1$ and next $v(0)=-1$, we immediately see that the further pair of requirements have to hold:
$$ \frac{\partial^2 f }{\partial x^2}|_{(x(0),0)}= 0 \:, \quad \frac{\partial^2 f }{\partial x \partial t }|_{(x(0),0)}=0\:.$$
Since the position $x(0)$ is arbitray and also the initial time $t=0$ is arbitrary (we can change it simply by translating the origin of our time), we have actually found that
$$\frac{\partial^2 f }{\partial t^2}|_{(x,t)}=0\:, \frac{\partial^2 f }{\partial x^2}|_{(x,t)}= 0 \:, \quad \frac{\partial^2 f }{\partial x \partial t }|_{(x,t)}=0\:.$$
In summary, the function $f$ must be a linear, generally non-homogeneous map:
$$x'= Ax + Bt+ C\:.$$
Restroring the constant $c$, we have found that, if both reference frames are inertial, then the transformation law of the coordinates of events are
$$t'=t+c\:, \quad x'= Ax + vt + d$$
The constant $A$ can be finally fixed to be $1$ by assuming that distances of points at fixed time are independent from the reference frame (absolute space in addition to absolute time of classical physics). The stadard Galileo's transformations show up this way:
$$t'=t+c\:, \quad x'= x + vt + d\:.\tag{1}$$
The result proves that the relativie motion of inertial frames is non-accelerated. Conversely if $S$ is inertial and $S'$ is not accelerated with respect to $S$, the acceleration of an isolated body is $0$ also in $S'$ in view of Galileo's law, hence also $S'$ is inertial.
Summing up, when assuming that time and space are absolute, if $S$ is inertial, then $S'$ is inertial if and only if $S'$ has motion with constant velocity with respect to $S$, that is equivalent to saying that (1) is true.