Is Newton's first law a special case of a more general law? I was reading my freshman physics textbook (fundamental's of physics by Jearl Walker), and the book says that Newton's first law only applies in a special frame of reference

Newton’s first law is not true in all reference frames, but we can always find reference frames in which it (as well as the rest of Newtonian mechanics) is true. Such special frames are referred to as inertial reference frames, or simply inertial
frames.

I have multiple questions about this paragraph:
What are frames of reference? What do they mean? I was not able to find a definition that I can understand at my current level. However, without knowing what a frame of reference is, I attempted to come up with another definition:
Assume that there's a set of all possible frames $R$, then we can rewrite the first law this way:

There exists a frame $r \in R$ such that, in the frame $r$ the following is always true:
$$a = 0 \iff f = 0$$

What do you think of my definition? Can we find other frames with different laws? Can we prove they exist?
 A: A reference frame is simply a system of co-ordinates measured relative to a specific point, which is the origin in that reference frame.
Often we use Cartesian co-ordinates in each reference frame (we don't have to, but this makes it simpler to define what we mean by a "straight line") and we rotate the co-ordinates in each reference frame so that the $x,y,z$ axes are aligned (again, we don't have to, but it makes life simpler). And we choose the origin in each reference frame so that all of the origins coincide at some specific time, which we call $t=0$.
We can then identify a particular point (or event) in spacetime by its co-ordinates and time relative to reference frame $A$ - say $(x_A, y_A, z_A, t)$. In another reference frame $B$ the same event will have different co-ordinates $(x_B, y_B, z_B, t)$. Note that because we are considering Newtonian mechanics here, the value of the time co-ordinate $t$ is the same in all reference frames - there is a universal time. If we were considering relativistic mechanics then $t$ would depend on the reference frame as well.
We can track the $(x_A, y_A, z_A)$ co-ordinates of some object $O$ in reference $A$ - in general these will depend on time $t$. If the $(x_A, y_A, z_A)$ co-ordinates of $O$ are constant (i.e. do not depend on $t$) then we say that $O$ is at rest relative to reference frame $A$. If the $(x_A, y_A, z_A)$ co-ordinates of $O$ depend linearly on time $t$ (so if $x_A(t) = x_A(0) + vt$ etc. ) then we say that $O$ is moving at a constant velocity relative to frame $A$.
By observing the co-ordinates of different events in reference frames $A$ and $B$, we can deduce a set of relations between the two sets of co-ordinates, and these relations hold for all events in spacetime. For example, if frame $B$ is moving relative to frame $A$ with constant velocity $v$ parallel to the $x$ axis then
$x_A = x_B + vt \\ y_A = y_B \\ z_A = z_B$
This is called a Galilean transformation. But if frame $B$ is accelerating relative to frame $A$ with constant acceleration $a$ parallel to the $x$ axis then
$x_A = x_B + \frac 1 2 at^2 \\ y_A = y_B \\ z_A = z_B$
and this is no longer a Galilean transformation.
If we have an object $O$ with no forces acting on it then we can define a reference frame $F_O$ in which this object is at rest (simply define the origin of the reference frame to be wherever that object is). Newtons' first law then says that any other object on which no forces act will either be at rest or will move with a constant velocity relative to reference frame $F_O$. And this will also be true in any other reference frame that is related to $F_O$ by a Galilean transformation.
However, Newton's first law will not be true in a reference frame that is related to $F_O$ by a non-Galilean transformation. In a reference frame that is accelerating relative to $F_O$ for example, then $O$ will appear to be accelerating even though there are no forces acting on it.
A: Imagine 3 mutually perpendicular rigid rods, with markings at uniform intervals, extending to infinity. The rigid rods form a reference frame.
We can use the reference frame to describe the motion of any physical particle in space, by saying how the particle is located relative to the markings on the rigid rods at any particular time.
Now we can imagine two reference frames -- two sets of 3 mutually perpendicular, infinite rods. The two reference frames can be:
(a) shifted relative to one other (the "origin" where the rods meet can be in different places)
(b) rotated to relative to one other (the rods can be pointing in different directions)
(c) moving relative to one other.
Point (c), in particular, is what you are asking about.
There will be some reference frames in which Newton's laws hold. What this means is that if you arrange your motion so that the rods of an "inertial reference frame" are not moving relative to you, then you will find that objects only move if a net external force is applied to them; that objects with mass $m$ will respond to an external force $F$ by moving with acceleration $a=F/m$; and that if object A exerts a force $F$ on object B, then object B exerts a force $-F$ on object A.
If you are in an inertial frame, and then you start accelerating (say you are in your car and put your foot on the pedal), then you will suddenly find that Newton's laws do not apply.
There are many examples of non-intertial reference frames. For example, imagine a pair of fuzzy dice hanging from your car windshield. In an inertial frame, they will simply hang straight down, pointing perpendicular to the surface of the earth. If you start accelerating, the fuzzy dice will start pointing toward the back of your car. This is due to a so-called "fictitious force" in your accelerating frame of reference.
I think the definition you wrote down actually is quite nice, but I added some extra details here that are hopefully helpful.
