A measurable function on an atom is almost everywhere constant

Looks like you almost have it: Try splitting $B$ into two sets.

More details:

Define $k$ as you did: $k\mu(A) = \int_{A} f \text{d}\mu$.

Let $B_1 = A \cap \{x: f(x) \gt k\}$

If $\mu(B) \gt 0$, then since $A$ is atomic, we have $\mu(A) = \mu(B)$ and thus

$ k\mu(A) = \int_{A} f \text{d}\mu = \int_{B_1} f \text{d}\mu \gt \int_{B_1} k\ \text{d}\mu = \int_{A} k\ \text{d}\mu = k \mu(A)$

Thus we must have that $\mu(B_1) \lt \mu(A)$ and so, $\mu(B_1) = 0$.

Similarly $\mu(B_2) = 0$ where $B_2 = A \cap \{x: f(x) \lt k\}$