Let us consider the DST (Discrete Sine Transform) which is very close to the DFT (Discrete Fourier Transform) and slightly simpler to understand:
The DST of order $N$ is defined by a matrix acting on vectors that represent discretized functions in this way:
$$\begin{pmatrix}\sin(1a)&\sin(2a)&\cdots&\sin(qa)&\cdots&\sin(na)\\
\sin(2a)&\sin(4a)&\cdots&\sin(2qa)&\cdots&\sin(2na)\\
\cdots&\cdots&\cdots&\cdots&\cdots&\cdots\\
\sin(pa)&\sin(2pa)&\cdots&\sin(pqa)&\cdots&\sin(pna)\\
\cdots&\cdots&\cdots&\cdots&\cdots&\cdots\\
\sin(na)&\sin(2na)&\cdots&\sin(nqa)&\cdots&\sin(n^2a)
\end{pmatrix}
\begin{pmatrix}f(h)\\f(2h)\\f(ph)\\\cdots\\\cdots\\f(nh)
\end{pmatrix}=\begin{pmatrix}g(h)\\g(2h)\\g(ph)\\\cdots\\\cdots\\g(nh)
\end{pmatrix}$$
with $a=\dfrac{2\pi}{n+1}$, and $h$ is the discretization step.
This matrix transforms the discretized function $f$ into the discretized function $g$.
The generic line-by-column product (line numbered $p$ by the column vector of $f$) is:
$$\sin(pa)f(h)+\sin(2pa)f(2h)+\cdots+\sin(pqa)f(qh)+\cdots+\sin(pna)f(nh)=g(ph)$$
which can be put into the form:
$$g(ph)=\sum_{q=1}^n \sin(pqa)f(qh)$$
It suffices now to "by analogy" to replace $\sum$ signs by $\int$ signs, and discrete values by continuous ones:
$$g(s)=\int_{t=0}^1 \sin(2\pi st)f(t)dt$$
Remark: the "details" concerning the replacement of a finite range of values by a continuous one may look rather arbitrary. In fact, other choices "by analogy" could be taken, in particular for dealing with infinite ranges of continuous variables. This would be necessary for the recovery of the so-called classical "continuous" sine transform. But our purpose here is only pedagogical.
These transformations methods, illustrated here by the building of a continuous transform out of a finite discrete one, constitute a very powerful "heuristical tool" : a method which helps you in the discovery (and understanding) of properties, relationships, etc.
But, let us repeat it, we work by analogy and no more than that.
Remark 1: It can be proved that the columns of the matrix of the discrete sine transform are orthogonal and have a common norm. Dividing by this norm, one has a privilegized orthonormal basis, a point that is important in the "analog" switch to Hilbert space $L^2$ (mentionned by @Stan Palasek), where so many things depend upon decompositions onto an orthogonal (or Hilbert space) basis.
Remark 2: I could have taken a different path and consider that we extend our matrix to infinity ($p,q=1,\cdots \infty$) with a convenient mathematical apparatus. This would have given a different "world"; but it is better not to mix up things that are not of the same nature.
Remark 3: You may have a look at a question I have asked some times ago about the relationship between discrete and continuous "worlds" and bridges that can be put between them: (Looking for examples of Discrete / Continuous complementary approaches).