Constructing the natural numbers without set theory. As I understand it the idea of defining everything as sets is a relatively new idea in mathematics.  Does that mean there's a non-set theoretic definition of the natural numbers?  Could there be?
 A: One way to construct the natural numbers (without sets) is type theory. We define an inductive type $\mathbb{N}$ with two constructors:
$$
1 : \mathbb{N}
$$
$$
S : \mathbb{N} \to \mathbb{N}
$$
Where $S$ "adds one" to a number. In this system $2$ is represented by $S(1)$, $3$ is represented by $S(S(1))$ etc. This is essentially a more direct implementation of the Peano axioms.
A: Here is a "naive" construction. A "natural number" is a sequence of (identical) marks. It doesn't really matter "which" mark you use (a vertical stroke, a star, a triangle, a circle or a letter from any alphabet are all acceptable choices). I shall use the letter x. So these are all examples of natural numbers:
xxxxxxx
xx
xxxxxxxxxxx
x
A new natural number is obtained from another by adding a single x at the end (either end, front or back, doesn't matter).
We define a way of making longer numbers from shorter ones, via concatenation:
xxxx $\oplus$ xxx = xxxxxxx.
In actual practice this operation sign is often omitted, as understood.
We define a second operation by taking "blocks" of marks (bi-directional arrays):
xxxx $\otimes$ xxx = 
xxxx
xxxx
xxxx
which we convert to a string sequence by laying the rows end-to-end.
I leave it to you, dear reader, to see if the Peano axioms for $\Bbb N - \{0\}$ are satisfied.
A: The natural numbers constructed in the category $\mathsf{Set}$ (objects are sets with functions as the arrows) are an example of a more general notion: that of a natural numbers object (NNO) in a topos (or a cartesian closed category). A topos can be thought of as a "universe" for doing mathematics, just as the category $\mathsf{Set}$ is used in classical foundations. The nlab article I linked to gives some explicit examples of NNO's in topoi other than $\mathsf{Set}$.
