You cannot. The IRS will not tell you.
If you or a dependent that you are entitled to claim has already been claimed by another taxpayer, your e-filed return will reject since the SSN has already been used (either intentionally or in error such as a mistyped SSN).
Your only recourse is to file a correct tax return, claiming what you are entitled to claim, then print and mail the return.
The IRS will process both returns and pay any refunds. Shortly (within a year) the IRS will mail letters to both taxpayers asking if their tax return was filed in error and suggesting that they amend if they improperly claimed.
If neither taxpayer amends, the IRS will send a second letter asking for each taxpayers proof that they are entitled to the claim.
The IRS will evaluate each taxpayers claim and award the credit to one taxpayer, the other will have to payback any refund received plus interest and possible penalties.
Do not ignore the letters or you will loose.
The IRS will not tell you, but if your e-file is being rejected for a duplicate Social Security number that might be the reason.
Someone else claimed my dependent and my return was rejected
If someone else claimed your dependent already, then your e-filed return will be rejected. Print, sign and mail your own return which claims your dependent. Mailed returns are processed differently by the IRS. It will take some time (maybe even up to a year) but eventually the IRS will contact both parties and sort out who could rightfully claim the dependent. The person who wrongfully claimed the dependent will face repayment of refund $, plus penalties.
When you mail a tax return, you need to attach any documents showing tax withheld, such as your W-2’s or any 1099’s. Use a mailing service that will track it, such as UPS or certified mail so you will know the IRS/state received the return.