During my physics classes I encountered various definitions on how to calculate the variation of a functional/function for certain "boundary conditions" and the thing is, I don't really understand if they are all equal or if I have to use some in certain situations...
Lets assume I have a functional of the form $$S[f] = \int_{x_i}^{x_f} d^4x\, \mathcal{L}(f(x), \partial_\mu f(x),x).$$ The first definition I ever saw was $$\delta S := \frac{d}{d \varepsilon} S[f+ \varepsilon \delta f]\Big|_{\varepsilon =0}\quad \text{where}\quad \delta f(x_i)=\delta f(x_f)=0.\label{1} \tag{1}$$ Sometime later I found $$\delta \mathcal{L}= \delta_o\mathcal{L} +\delta x^\mu \partial_\mu \mathcal{L}\label{2}\tag{2},$$ where $$\delta x^\mu = (x^\mu)'-x^\mu,\quad \delta_o f= f'(x)-f(x),\quad \delta f = f'(x')-f(x),$$ for $x\mapsto x'$ some kind of transformation. I also saw $$\delta\mathcal{L} = \frac{\delta \mathcal{L}}{\delta f}\delta f + \frac{\delta \mathcal{L}}{\delta(\partial_\mu f)}\partial_\mu \delta f \quad\text{where} \quad [\delta, \partial_\mu]=0\label{3}\tag{3}$$ was stated without any explanation.
The only thing that the above "$\delta$" all had in common was, that no at single of the professors really explaind what I was supposed to do with them.
TL;DR: How is this $\delta$ defined, is $\delta \mathcal{L}$ different from $\delta S$ and $\frac{\delta \mathcal{L}}{\delta f}$? And if someone tells me to calculate $\delta \mathcal{L}$, how am I supposed to do this?
Preferably, I'd like to see an example for a global symmetry and a local symmetry transformation and how to calculate $\delta\mathcal{L}$ (it seems that different rules apply here).
Well I can see that your first and third definitions are compatible.But the second one I don't understand. Start from your first definition: $$ \delta S = \frac{d}{d\varepsilon}(f+\varepsilon \delta f) = \lim_{\varepsilon\rightarrow0}\frac{1}{\varepsilon}\int_{x_i}^{x_f}\left[\mathcal{L}((f+\varepsilon \delta f),\partial_{\mu}(f+\varepsilon \delta f),x)-\mathcal{L}(f,\partial_{\mu}f,x)\right]d^4x = \int_{x_i}^{x_f}(\frac{\partial \mathcal{L}}{\partial f}\delta f+\frac{\partial \mathcal{L}}{\partial (\partial_{\mu}f)})\delta (\partial_{\mu}f))d^4x $$ Because the operator $\delta$ performs on $f$ but the operator $\partial_{\mu}$ performs on $x$, $[\delta,\partial_{\mu}]=0$.
Then from your third definition: $\delta S= \int_{x_i}^{x_f}\delta \mathcal{L}d^4x$