but how do you know the exact price you received it then for tax purposes?
Again... there is no "exact" price... so you're asking for the "impossible"
The best you can do is approximate... There are services that offer historical BTC prices (usually averaged across major exchanges to flatten out localised dips/spikes), usually via API's etc... that's how most of the "price history" charts work.
How you choose to deal with that for "tax purposes" is up to your, your tax department and any rules they may enforce on calculating prices.
I heard of that double spending with btc. So if someone sends me btc and say i send them cash or online funds... how do i make sure that transaction won't get double spend?
...
How do you counter against that? Do you look at the transaction fee that person paid for the transfer or how?
Transaction fee means nothing... The only thing you need to look for is number of confirmations.
Zero confirmations means exactly that... ZERO confirmations, the coins could still be theoretically double spent in another transaction with a higher fee. These days, with the current level of total hash power, executing a 51% attack is nearly impossible... at the very least it would be insanely expensive.
So, any non-zero number of confirmations (ie. 1 or more) means that the transaction is, for all intents and purposes, basically irreversible. If you're dealing in transactions of massive value (ie. $10s/$100s millions) you might want to wait for a few more like 3 or 6 etc.... but in general 1 confirmation should be enough and considered the absolute minimum.
Same with RBF... if someone sends an "RBF enabled" transaction, it should not be "trusted" until there is at least 1 confirmation. At that point, RBF cannot be used to "respend" coins.