Actually that integral is not really the definition. The definition
of the length of the graph of $f$ for $a\le x\le b$ is the sup of the sums $$\sum_{j=1}^n\left((x_j-x_{j-1})^2+(f(x_j)-f(x_{j-1})^2\right)^{1/2}$$over all choices $a+x_0<\dots<x_n=b$. That sum is just the length of a polygonal path joining points of the graph of $f$, so it makes sense as the definition of the length.
Now if we assume that $f'$ is continuous it's possible to prove that the length is equal to that integral.
EDIT: Regarding the question of what makes this definition "correct": Of course that's meaningless in a mathematical sense, a definition is a definition. It's not meaningless to ask why it makes sense as a definition of arc length.
One way to look at it is this: What is the "length" of a curve anyway? It's the net distance you travel if you walk along the curve. But your pedometer doesn't have a magic arc-lenght measurer - all it can do is measure the distance between successive steps and add. That's what that sum does. Except of course oops, measuring the distance between this step and the next underestimates the arc length because it ignores wiggles on a scale smaller than the step size. Hence the "sup".
Is there any doubt that the derivative of a differentiable function actually defines the slope of the graph at every point on the graph of that function? I ask this because most students understand the limit definition of a derivative as algebraic proof of this fact. This sets up a single unique connection between a function and its derivative.
In practical terms, given a distance function $s = 1/3t^3$, we can determine the velocity at every instant, say on the interval $t=0$ to $t=4$, over which the distance traveled is $21\frac{1}{3}$ units. We are able to do this using the derivative $v = t^2$. So, given a distance function, we can obtain velocities at every instant. Example: the velocity at $t = 3$ will be $9$ units per second
Now, given the unique connection between a function and its derivative, shouldn't it work in reverse? That is, given a velocity function, shouldn't we be able to determine distance traveled over any time interval. Working backwards then, after 4 seconds of changing velocity via $v = t^2$, we look at the anti-derivative of the velocity function $s = 1/3 t^3$ the distance function, to get the distance traveled. In proper math terminology, it's the definite integral of the velocity function over the time interval $t = 0$ to $t = 4$. When we evaluate this we get the previously mentioned $21\frac{1}{3}$ units.
So now we need to make the connection between the definite integral evaluation and the area under the velocity graph. It is fairly obvious that a velocity graph at a constant velocity will reveal the distance traveled as the area of the rectangle from say $t1$ to $t2$. Distance being the product of velocity and time, the vertical height and width of the rectangle. For non constant velocity graphs, we can make approximations of these rectangles with narrow vertical strips where we sum the areas. The narrower the strips the closer we get to the actual distance approaching total accuracy as the number of strips approaches infinity and the width of the strips approaches zero. It comes as no surprise that this highly accurate measuring technique produces an identical result to the definite integral method previously calculated. That is, both methods actually calculate the true distance traveled.
This isn't a proof but its an explanation to help dispel any doubt.
Best Answer
I also cannot read Weierstraß' mind, but I can read the note in the Wikipedia article which says that Weierstraß actually proposed neither of the integrals you and the other answers discuss as a definition, but rather
$$\pi := \displaystyle \int_{-\infty}^\infty \frac{dx}{1+x^2}$$
And I can read the free preview of the reference for that, namely, p. 148 of Remmert's article on $\pi$ in Ebbinghaus et al.'s Numbers book. It explains that Weierstraß' starting point, unsurprisingly for a complex analyst, would have been
$$\int_{S^1} \frac{dz}{z} =2\pi i$$
i.e. more thinking of the circumference of the unit circle $S^1$. And further, that Weierstraß used the parametrization $z(\lambda) = \frac{1+i\lambda}{1-i\lambda}$, $-\infty <\lambda <\infty$ for the unit circle (which, by the way, is the special case for Hilbert 90 everyone should have seen once), which makes
$$\int_{S^1} \frac{dz}{z} = 2i \displaystyle \int_{-\infty}^\infty \frac{dx}{1+x^2}$$
One can of course further note that by symmetry
$$\int_{-\infty}^\infty \frac{dx}{1+x^2} = 2 \int_0^\infty \frac{dx}{1+x^2}$$
and by $x \mapsto x^{-1}$,
$$\int_0^1 \frac{dx}{1+x^2} = \int_1^\infty \frac{dx}{1+x^2}$$
so that alternatively, if we dislike improper integrals, we can set
$$\pi := 4 \int_0^1 \frac{dx}{1+x^2}$$
In chapter 6 §1 no. 3 of Remmert's book Theory of Complex Functions (p. 174/175 here), he expands this a little and quotes from Weierstraß that all he needs to build function theory from the above is this integral gives a finite, nonzero number.
Note that this definition does not even involve roots (which, as one learns in higher math, are more intricate than they seem in high school) -- in fact, the definition
$$\pi := 4 \int_0^1 \frac{dx}{1+x^2}$$
only involves a finite integral with easiest bounds over a rational function with easiest coefficients. It would be hard to find a more "rational"/"algebraic" definition for the (very irrational and un-algebraic) number $\pi$.
The exact Weierstraß reference is "Darstellung einer analytischen Function einer complexen Veränderlichen, deren absoluter Betrag zwischen zwei gegebenen Grenzen liegt", written in 1841, but published only in 1894 in the collected Mathematische Werke. That is available online at https://doi.org/10.1017/CBO9781139567787.003 but you need institutional access for this.
Edit: Luckily, user M. Lonardi found this free version of Weierstraß' paper: https://archive.org/details/mathematischewer01weieuoft/page/52/mode/2up?view=theater in their post here.