Technically speaking, you already have both right there on your phone/laptop/desktop. Those components are already built onto the circuit boards.
It’s important to understand the components as individuals so that you can make a better judgment call. I’ll briefly try to go for the cliff notes version.
A digital-to-analog converter, shortened to DAC, is a device that can take a digital signal (think a bunch of 1s and 0s) and turn it into an analog signal (which looks like a wave). The better quality and better implemented a DAC chip is, the better your output signal.
An amplifier does exactly what the name implies; it amplifies the signal by applying what is known as “gain.”
Now, there are nuances to both that really take more research to really understand. For example, an amp should, in theory, only amplify the signal, but tube amps, in particular, can add a little distortion to the sound (sometimes called color) that some people find pleasing to the ears.
The Bottom Line
To get back to the question, are they absolutely necessary to have together? Yes, you need both in order to hear a sound out of your headphones/speakers. The question really is, “what is more important to you?”
There is no real “wrong” way to start in this hobby. In my experience, the medium of sound (headphones/speakers) make the single largest impact on sound quality, followed by the amp, then the DAC. Source quality also matters a lot, as it has a progressively larger impact, the better your system becomes.