The approach to frequency shift a signal is best described with complex signals (the easiest way I find to explain SSB as well). We can frequency translate a real waveform x(t) by converting it to an analytic signal with a Hilbert Transform (which for narrow band signals simply means using a quadrature splitter), and then multiplying this resulting complex signal (represented by two real signals) with a complex rotating phasor (which we can implement with two quadrature signals, one as the sine and one as the cosine for the frequency offset we desire):
$$y(t) = x_a(t) e^{j\omega_s t} \label{1} \tag{1}$$
Where $x_a(t)$ is the analytic signal for some real waveform $x(t)$. The analytic signal is found with the Hilbert Transform as:
$$x_a(t) = x(t) + j\mathscr{H}\{x(t)\}$$
The Fourier Transform of $\ref{1}$ the above is:
$$Y(\omega) = X(\omega + \omega_s)$$
Which is basically saying a rotating phasor in time is a translated impulse in frequency. A single tone in time is a single impulse in frequency, so if we time multiply it by a rotating phasor (which is a linearly increasing or decreasing phase), we translate that tone in frequency. (Quite simple!! You have a spinning bike wheel, and you spin it faster!)
The long way to explain this is with sines and cosines but shows the implementation as given by Euler's relationship between complex exponentials and sinusoids:
$$e^{j\omega t} = \cos(\omega t)+ j\sin(\omega t)$$
If you multiply that out into the expression above, you'll see it matches an implementation where we use two real signals to represent the complex datapath: taking the real of $y(t)$ results in a real frequency translated signal. For example:
$$x(t) = \cos(\omega_1 t)$$
$$x_a(t) = \cos(\omega_1 t)+ j\mathscr{H}\{\cos(\omega_1 t)\} = \cos(\omega_1 t) + j\sin(\omega_1 t) = e^{j\omega_1 t}$$
$$y(t) =x_a(t)e^{j\omega_s t} = e^{j\omega_1 t}e^{j\omega_s t} = e^{j(\omega_1+\omega_s) t}$$
$$ = \cos((\omega_1+\omega_s) t) + j\sin((\omega_1+\omega_s) t)$$
$$ \mathscr{R}\{y(t)\} = \cos((\omega_1+\omega_s) t) $$
I explain this in more detail at this post.
Here is an additional example doing it for shifting the frequency downward and the "long way" using cosine and sine product formulas:
$$x(t) = \cos(\omega_1 t)$$
$$x_a(t) = \cos(\omega_1 t) + j\sin(\omega_1 t)$$
$$y(t) = x_a(t) \bigg(\cos(\omega_{\Delta} t) - j\sin(\omega_{\Delta} t)\bigg)$$
$$ = \bigg(\cos(\omega_1 t) + j\sin(\omega_1 t)\bigg)\bigg(\cos(\omega_{\Delta} t) - j\sin(\omega_{\Delta} t)\bigg)$$
$$ \mathscr{R}\{ y(t) \} = \cos(\omega_1 t)\cos(\omega_{\Delta} t) + \sin(\omega_1 t)\sin(\omega_{\Delta} t)$$
$$ = \frac{1}{2}\cos((\omega_1+\omega_{\Delta}) t)) + \frac{1}{2}\cos((\omega_1- \omega_{\Delta}) t)) + \frac{1}{2}\cos((\omega_1-\omega_{\Delta}) t)) - \frac{1}{2}\cos((\omega_1+ \omega_{\Delta}) t))$$
$$= \cos((\omega_1- \omega_{\Delta}) t))$$
Relationship to FM and PM:
Note that in the process above when we multiply an arbitrary carrier with magnitude and phase described as $x(t) = A(t)e^{j \omega_c(t)}$ by $e^{j\theta(t)}$ we are performing phase modulation where $\theta(t)$ is the phase of the modulation versus time.
$y(t) = A(t)e^{j \omega_c}e^{j\theta(t)} = A(t) e^{j (\omega_c + \theta(t))}$
Frequency is the time derivative of phase, so if we wish to describe this with an FM function $f(t)$ where $f(t)$ is the instantaneous frequency versus time in Hz, we use the following conversion between the two:
$$\theta(t) = 2\pi\int f(t)dt$$
So the same $y(t)$ waveform above would be produced by an FM waveform $f(t)$ and given as:
$y(t) = A(t)e^{j \omega_c}e^{j\theta(t)} = A(t) e^{j (\omega_c + (2\pi\int f(t)dt))}$
The above gets quite complicated, resulting in the use of Bessel functions to produce non-linear side-bands, but to bring this back to the OP's question of a case where the frequency increases if we raise a function's value and a frequency decreases if we lower a function's value, consider the case of a static frequency offset using FM: in this case $f(t)$ (which is the function the OP refers to) is a simple constant. The phase as the integral is a simple ramp and we see that this can be accomplished by multiplying our waveform with a phasor of linearly increasing phase (to shift a frequency up) or linearly decreasing phase (to shift the frequency down), consistent with the first explanations given above and as given specifically in equation \ref{1}.