Definition of energy of a signal
As we know $E = Pt$ where $E$ is the energy and $t$ is the time. In the continuous domain $t$ is never ending and its beginning isn't known either. 

Now, signals in the continuous domain are voltages and as you know from Ohm's Law $V = IR$ and $P = I^2R$. 

This basically tells you that for a given resistance $R$, the energy of a signal over a time interval is given by the integration of the power. So,

$$ E = \int\limits_{t_1}^{t_2} P(t) ~dt$$

which in this case becomes

\begin{align}
E &amp;= \int\limits_{-\infty}^{\infty} I^2(t)R ~dt\\
&amp;= R\int\limits_{-\infty}^{\infty} I^2(t) ~dt\\
&amp;= \int\limits_{-\infty}^{\infty} I^2(t) ~dt~~\text{(For $R = 1$)}
\end{align}

Usually in SP world we like to represent the signal as $x(t)$ giving us

$$E = \int\limits_{-\infty}^{\infty} \left|x(t)\right|^2 ~dt$$

Hope this helps!