How to tell if a high-res flac file has been upsampled from a CD-quality file?
Let's get some basics out of the way first.
An audio format is basically defined by three different things: sample rate, bit depth and compression type. The compression type can be either lossless (WAV, PCM, FLAC, ALAC) or &quot;lossy&quot; (AAC, MP3, OGG, MQA, etc). Lossy compression works by shaping the quantization noise so it's masked by the remaining content and inaudible. Lossy formats are characterized by their bit-rate: the higher the bit-rate, the less quantization is done.
The typical life cycle is the following: recording, mixing and happens at 96kHz floating point. When that's done, there are typically two masters made: a studio master at 96kHz/24-bit and a CD master at 44.1kHz/16-bit.
The label will send one of these two to the distribution channel, e.g. Spotify. Which one depends on the contract. Spotify will then create the formats that they need for their streaming platform, which almost always includes lossy compression. For example Spotify uses OGG at 320 kb/s. Apple Music uses AAC at 256 kb/s. Which format gets to the customer depends on the contract between the customer and the distribution.

Is there anyway I can tell apart a &quot;fake&quot; high-res file (converted from CD-quality or mp3/aac) apart from a &quot;real&quot; high-res file

Here are a few things to look for in a spectral analysis

Each format has it's own rolloff: CD drops like a rock at 20 kHz and MP3 drops steeply at 16 kHz. If you have a 96 kHz file with these sharp drop offs, it's likely been up-sampled.
Inspect the content above 20 kHz. If there is random &quot;noise like&quot; features in there, it's probably genuine. If it has very little content and/or the content looks like a low-pass filtered mirror image of the content below 20 kHz, it's been up-sampled.
You can look at correlation at high frequencies. For a genuine recording this will mostly be uncorrelated. If there is significant correlation, it's a potential sign of &quot;joint stereo coding&quot; which could hint at lossy compression.
Look at the recording date: If it's been made before 1990 it's almost guaranteed to be up-sampled. There never was a digital studio master and the best they can do is to sample a tape master.

Some formats like MQA, include authentication, i.e. they put a &quot;seal&quot; on the content and can detect whether the &quot;seal&quot; has been tampered with. It's also possible to put a watermark on the content.
Update
You may be able to detect bit padding as well: Any &quot;decent&quot; CD quality file have been properly noise shaped and dithered. It's possible that signs of this will survive the up sampling process can be detected. I've neve tried that, so I don't know how feasible it is, but it sure would be interesting to try.