  We examine the correlations of star formation rate (SFR) and gas-phase
metallicity $Z$. We first predict how the SFR, cold gas mass and $Z$ will
change with variations in inflow rate or in star-formation efficiency (SFE) in
a simple gas-regulator framework. The changes $\Delta {\rm log}$SFR and $\Delta
{\rm log} Z$, are found to be negatively (positively) correlated when driving
the gas-regulator with time-varying inflow rate (SFE). We then study the
correlation of $\Delta {\rm log}$sSFR (specific SFR) and $\Delta {\rm
log}$(O/H) from observations, at both $\sim$100 pc and galactic scales, based
on two 2-dimensional spectroscopic surveys with different spatial resolutions,
MAD and MaNGA. After taking out the overall mass and radial dependences, which
may reflect changes in inflow gas metallicity and/or outflow mass-loading, we
find that $\Delta {\rm log}$sSFR and $\Delta {\rm log}$(O/H) on galactic are
found to be negatively correlated, but $\Delta {\rm log}$sSFR and $\Delta {\rm
log}$(O/H) are positively correlated on $\sim$100 pc scales within galaxies. If
we assume that the variations across the population reflect temporal variations
in individual objects, we conclude that variations in the star formation rate
are primarily driven by time-varying inflow at galactic scales, and driven by
time-varying SFE at $\sim$100 pc scales. We build a theoretical framework to
understand the correlation between SFR, gas mass and metallicity, as well as
their variability, which potentially uncovers the relevant physical processes
of star formation at different scales.
