If $X:\Omega\times\mathbb{R}\rightarrow\mathbb{R}$ is a stochastic process which is a semimartingale (that is one can write X as the sum of a local martingale starting at zero and a process of finite variation; so every martingale starting at zero is a semimartingale), the stochastic integral $$\int_0^Tf(t)dX(t)$$ (sometimes also written as $(f\dot\ X)_T$) is first defined for simple predictable processes $f$ of the form $f=1_{\{(\omega,t)|r<t\leq s\}}$ ($r,s\in\mathbb{R}$ and $r<s$) as $$\int_0^Tf(t)dX(t)=f(\min(s,T))-f(\min(r,T))$$ for $T\geq 0$ and the mapping $f\mapsto f\dot\ X$ from the simple predictable processes as domain will be extended to the set of predictable processes s.t. that $$(\omega,t)\mapsto (f\dot\ X)_t(\omega)$$ is adapted, $f\mapsto f\dot\ X$ is linear and if $f_n$ converges to $f$ pointwise and the $f_n$ are bounded, then $(f_n\dot\ X)_t\rightarrow (f\dot\ X)_t$ for $t\geq 0$.
If $X$ is a process of finite variation (hence it is a semimartingale), then the stochastic integral $(f\dot\ X)_T$ is just the Lebesgue–Stieltjes-integral.
Under certain conditions, if $(X_t)_{t\geq 0}$ is a martingale, then also $((f\dot\ X)_T)_{T\geq 0}=(\int_0^Tf(t)X_t)_{T\geq 0}$ is a martingale.
To understand the process of defining the stochastic integral, i suggest to look it up in any stochastic calculus text book.