From the photo and history, this looks most consistent with a minor bruise / subungual hemorrhage or nail-bed pigmentation. Sudden appearance, painless nature, and no growth history make skin cancer very unlikely. Skin cancers do not appear overnight.
Next Steps
• Observe the spot for 2–4 weeks
• It should fade or move forward with nail growth
• If it increases in size, changes color, spreads to surrounding skin, or does not move, consult a dermatologist
Health Tips
• Do not panic based on Google images
• Avoid repeated pressure or trauma to the finger
• Seek urgent review only if there is rapid change, pain, bleeding, or nail distortion