In high-energy hadronic collisions, hard parton scatterings with large momentum transfers are prerequisites for the formation of hard and rare probes. In heavy-ion collisions, these probes$-$final state particles related to the early hard-parton scatterings$-$serve as a powerful tool to explore the whole evolution of the medium including the quark$-$gluon plasma (QGP) stage. Hard probes in proton-proton (pp) collisions test perturbative quantum chromodynamics (pQCD) processes and hadronization, and provide a reference for the nuclear collision systems. High-multiplicity pp collisions provide a bridge to heavy-ion collisions, due to their large event activity.
Heavy-flavor hadrons containing at least one charm or beauty quark belong to the hard and rare probes. Recently, ALICE has measured a broad palette of heavy-flavour baryons allowing to shed more light on charm fragmentation. Measurements of charmonium production as a function of the event multiplicity can provide insight into the interplay between charmonium-production processes and soft processes driving the multiplicity. ALICE has investigated the multiplicity dependence of J/$\psi$ production at midrapidity and the ratio of $\psi \rm (2S)$ to J/$\psi$ yields at forward rapidity. The charm and beauty cross sections can be constrained by fits of Monte-Carlo generators to the measured dielectron continuum.