simulate this circuit – Schematic created using CircuitLab
If the current flows counterclockwise, the current source becomes invalid but if it flows clockwise the voltage source becomes invalid? So what would happen?
simulate this circuit – Schematic created using CircuitLab
If the current flows counterclockwise, the current source becomes invalid but if it flows clockwise the voltage source becomes invalid? So what would happen?
You seem to think that you have created a problem, but not in this case. The 1A will flow through current source, there will be 1V across the voltage source. The current source will have the voltage over it that makes this happen, likewise the voltage source will have the current through it to make this happen (which must be 1A).
1A flows through the resistor too. Let's (arbitrarily) define its lefts side as 0V, then its right side must be at +100V, hence the voltage over the current source is 99V.
If you invert the current source the right side of the resistor is at -100V, hence the voltage over the current source is -101V.
Note that voltage sources and current sources are theoretical constructs, just like a line, circle and point. You can create 'impossible' diagrams with them, for instance a shorted voltage source or an open current source, or voltage sources for different voltages in parallel. It makes no sense to ask 'what would happen in such a case' because those idealized components do not exist. We can calculate with them within certain restrictions, outside those restrictions we can't calculate with them. That's all.
So what would happen?
This is straightforward - because of the current source, there is a clockwise current of \$1A\$.
By Ohm's law, the voltage across the resistor is
$$V_R = 1A \cdot 100 \Omega = 100V$$
with the rightmost terminal the more positive. By KVL, voltage across the current source is then
$$V_{I1} = 1V - 100V = -99V$$
Thus, the current source is supplying \$99V \cdot 1A = 99W\$ of power to the circuit.
The current through the voltage source is, by inspection, \$-1A\$ (the current enters the more negative terminal) thus, the voltage source supplies \$1V \cdot 1A = 1W \$ of power.
The power delivered to the resistor is
$$p_R = \frac{v^2_R}{R} = \frac{100^2}{100} = 100W$$
which must equal the sum of the power delivered by the sources which is
$$p_{V1} + p_{I1} = 1 + 99 = 100W $$
Both voltage and current source contribute to the circuit. Current through resistor R1 is sum of current contributed by two sources (super position theorem) . But here Current source is in series with voltage source.
Assuming ideal condition, internal resistance of current source is infinity. Therefore no current from voltage source flows through it.
The only current through resistor R1 is current from current source ie 1A